harmonyc 0.12.1 → 0.12.2

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.
@@ -127,8 +127,6 @@ export class VitestGenerator {
127
127
  this.tf.print(`(context.task.meta.variables ??= {})[${str(action.variableName)}] = ${action.value.toCode(this)};`);
128
128
  }
129
129
  saveToVariable(s, what = this.extraArgs[0] + ';') {
130
- if (this.extraArgs.length !== 1)
131
- return;
132
130
  this.tf.print(`(context.task.meta.variables ??= {})[${str(s.variableName)}] = ${what}`.trimEnd());
133
131
  }
134
132
  stringLiteral(text, { withVariables }) {
@@ -0,0 +1,27 @@
1
+ import { expect } from 'vitest';
2
+ export class TestPhrases {
3
+ constructor(context) {
4
+ this.context = context;
5
+ }
6
+ When_goodbye() {
7
+ throw new Error('Goodbye, World!');
8
+ }
9
+ When_hello() {
10
+ return (this.context.task.meta.greeting = 'Hello!');
11
+ }
12
+ When_greet_(name) {
13
+ this.context.task.meta.greeting = `Hello, ${name}!`;
14
+ }
15
+ async Then__is_(x, y) {
16
+ expect(x).toBe(y);
17
+ }
18
+ Then_last_char(s) {
19
+ return s.slice(-1);
20
+ }
21
+ Then_last_char_of_greeting() {
22
+ return this.context.task.meta.greeting.slice(-1);
23
+ }
24
+ Then_(s, r) {
25
+ expect(s).toBe(r);
26
+ }
27
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "harmonyc",
3
3
  "description": "Harmony Code - model-driven BDD for Vitest",
4
- "version": "0.12.1",
4
+ "version": "0.12.2",
5
5
  "author": "Bernát Kalló",
6
6
  "type": "module",
7
7
  "bin": {