harmonyc 0.8.2 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -50,7 +50,7 @@ export class NodeTest {
|
|
|
50
50
|
this.featureVars = new Map();
|
|
51
51
|
// avoid shadowing this import name
|
|
52
52
|
this.featureVars.set(new Object(), this.currentFeatureName);
|
|
53
|
-
this.tf.print(`test(${str(t.name)}, async () => {`);
|
|
53
|
+
this.tf.print(`test(${str(t.name)}, async (context) => {`);
|
|
54
54
|
this.tf.indent(() => {
|
|
55
55
|
for (const step of t.steps) {
|
|
56
56
|
step.toCode(this);
|
|
@@ -94,7 +94,7 @@ export class NodeTest {
|
|
|
94
94
|
let f = this.featureVars.get(feature);
|
|
95
95
|
if (!f) {
|
|
96
96
|
f = toId(feature, abbrev, this.featureVars);
|
|
97
|
-
this.tf.print(`const ${f} = new ${pascalCase(feature)}Phrases();`);
|
|
97
|
+
this.tf.print(`const ${f} = new ${pascalCase(feature)}Phrases(context);`);
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
}
|
|
@@ -167,7 +167,10 @@ export function functionName(phrase) {
|
|
|
167
167
|
const { kind } = phrase;
|
|
168
168
|
return ((kind === 'response' ? 'Then_' : 'When_') +
|
|
169
169
|
([...phrase.content, phrase.docstring ? [phrase.docstring] : []]
|
|
170
|
-
.flatMap((c) => c instanceof Word
|
|
171
|
-
.filter((x) => x)
|
|
172
|
-
|
|
170
|
+
.flatMap((c) => c instanceof Word
|
|
171
|
+
? words(c.text).filter((x) => x)
|
|
172
|
+
: c instanceof Arg
|
|
173
|
+
? ['']
|
|
174
|
+
: [])
|
|
175
|
+
.join('_') || ''));
|
|
173
176
|
}
|