harmonyc 0.22.0 → 0.22.1
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.
package/README.md
CHANGED
|
@@ -23,6 +23,10 @@ export default {
|
|
|
23
23
|
|
|
24
24
|
This will run .harmony files in vitest.
|
|
25
25
|
|
|
26
|
+
### Auto-generating phrases files and methods
|
|
27
|
+
|
|
28
|
+
The Vitest plugin will auto-generate phrases files or edit them to add necessary phrase methods whenever you change your .harmony files. It will automatically sort phrase methods.
|
|
29
|
+
|
|
26
30
|
## VSCode plugin
|
|
27
31
|
|
|
28
32
|
Harmony Code has a [VSCode plugin](https://marketplace.visualstudio.com/items?itemName=harmony-ac.harmony-code) that supports syntax highlighting.
|
|
@@ -79,14 +83,16 @@ becomes
|
|
|
79
83
|
```javascript
|
|
80
84
|
test('T1 - strings', async () => {
|
|
81
85
|
const P = new Phrases()
|
|
82
|
-
await P.
|
|
86
|
+
await P.When_hello_X('John')
|
|
83
87
|
})
|
|
84
88
|
test('T2 - code fragment', async () => {
|
|
85
89
|
const P = new Phrases()
|
|
86
|
-
await P.
|
|
90
|
+
await P.When_greet_X_times(3)
|
|
87
91
|
})
|
|
88
92
|
```
|
|
89
93
|
|
|
94
|
+
Arguments are added to the function name as `X`, `Y`, `Z`, `A`, `B` etc.
|
|
95
|
+
|
|
90
96
|
### Labels
|
|
91
97
|
|
|
92
98
|
Labels are lines that start with `-` or `+` and end with `:`. You can use them to structure your test design.
|
|
@@ -127,7 +133,7 @@ becomes
|
|
|
127
133
|
test('T1 - set variable', (context) => {
|
|
128
134
|
const P = new Phrases();
|
|
129
135
|
(context.task.meta.variables ??= {})['name'] = "John";
|
|
130
|
-
await P.
|
|
136
|
+
await P.When_greet_X(context.task.meta.variables?.['name']);
|
|
131
137
|
})
|
|
132
138
|
test('T2 - store result in variable', (context) => {
|
|
133
139
|
const P = new Phrases();
|
|
@@ -22,7 +22,7 @@ export class VitestGenerator {
|
|
|
22
22
|
this.extraArgs = [];
|
|
23
23
|
}
|
|
24
24
|
feature(feature) {
|
|
25
|
-
const phrasesModule = './' + basename(this.sourceFileName.replace(/\.harmony$/, '.phrases
|
|
25
|
+
const phrasesModule = './' + basename(this.sourceFileName.replace(/\.harmony$/, '.phrases'));
|
|
26
26
|
const fn = (this.featureClassName =
|
|
27
27
|
this.currentFeatureName =
|
|
28
28
|
pascalCase(feature.name) + 'Phrases');
|
package/package.json
CHANGED