vitest-gwt 0.0.3-alpha.2 → 4.0.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.
package/lib/index.js CHANGED
@@ -1,7 +1,11 @@
1
- import { test as vitest, beforeEach as vitestBeforeEach, afterEach as vitestAfterEach, } from 'vitest';
2
- import gwtRunner, { TestContext } from 'gwt-runner';
3
- import withAspectBuilder from './withAspect.js';
4
- export default gwtRunner(vitest);
5
- export { TestContext };
6
- export const withAspect = withAspectBuilder(vitestBeforeEach, vitestAfterEach);
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.withAspect = exports.TestContext = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const vitest_1 = require("vitest");
6
+ const gwt_runner_1 = tslib_1.__importStar(require("gwt-runner"));
7
+ Object.defineProperty(exports, "TestContext", { enumerable: true, get: function () { return gwt_runner_1.TestContext; } });
8
+ const withAspect_1 = tslib_1.__importDefault(require("./withAspect"));
9
+ exports.default = (0, gwt_runner_1.default)(vitest_1.test);
10
+ exports.withAspect = (0, withAspect_1.default)(vitest_1.beforeEach, vitest_1.afterEach);
7
11
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,IAAI,MAAM,EACd,UAAU,IAAI,gBAAgB,EAC9B,SAAS,IAAI,eAAe,GAC7B,MAAM,QAAQ,CAAC;AAChB,OAAO,SAAS,EAAE,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,iBAAiB,MAAM,iBAAiB,CAAC;AAEhD,eAAe,SAAS,CAAC,MAAM,CAAC,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,CAAC;AAEvB,MAAM,CAAC,MAAM,UAAU,GAAG,iBAAiB,CAAC,gBAAgB,EAAE,eAAe,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,mCAIgB;AAChB,iEAAoD;AAI3C,4FAJW,wBAAW,OAIX;AAHpB,sEAA6C;AAE7C,kBAAe,IAAA,oBAAS,EAAC,aAAM,CAAC,CAAC;AAGpB,QAAA,UAAU,GAAG,IAAA,oBAAiB,EAAC,mBAAgB,EAAE,kBAAe,CAAC,CAAC"}
package/lib/withAspect.js CHANGED
@@ -1,14 +1,16 @@
1
- import { TestContext } from 'gwt-runner';
2
- export default (beforeEach, afterEach) => ((before, after) => {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const gwt_runner_1 = require("gwt-runner");
4
+ exports.default = (beforeEach, afterEach) => ((before, after) => {
3
5
  beforeEach(async () => {
4
- TestContext.createContext();
5
- await before.bind(TestContext.context)();
6
+ gwt_runner_1.TestContext.createContext();
7
+ await before.bind(gwt_runner_1.TestContext.context)();
6
8
  });
7
9
  afterEach(async () => {
8
10
  if (after) {
9
- await after.bind(TestContext.context)();
11
+ await after.bind(gwt_runner_1.TestContext.context)();
10
12
  }
11
- TestContext.releaseContext();
13
+ gwt_runner_1.TestContext.releaseContext();
12
14
  });
13
15
  });
14
16
  //# sourceMappingURL=withAspect.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"withAspect.js","sourceRoot":"","sources":["../src/withAspect.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAIzC,eAAe,CACb,UAAmC,EACnC,SAAiC,EACjC,EAAE,CAAC,CACH,CACE,MAAmB,EACnB,KAAmB,EACnB,EAAE;IACF,UAAU,CAAC,KAAK,IAAI,EAAE;QACpB,WAAW,CAAC,aAAa,EAAE,CAAC;QAE5B,MAAO,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,OAAY,CAAS,EAAE,CAAC;IACzD,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,KAAK,IAAI,EAAE;QACnB,IAAI,KAAK,EAAE,CAAC;YACV,MAAO,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,OAAY,CAAS,EAAE,CAAC;QACxD,CAAC;QAED,WAAW,CAAC,cAAc,EAAE,CAAC;IAC/B,CAAC,CAAC,CAAC;AACL,CAAC,CACF,CAAC"}
1
+ {"version":3,"file":"withAspect.js","sourceRoot":"","sources":["../src/withAspect.ts"],"names":[],"mappings":";;AAIA,2CAAyC;AAIzC,kBAAe,CACb,UAAmC,EACnC,SAAiC,EACjC,EAAE,CAAC,CACH,CACE,MAAmB,EACnB,KAAmB,EACnB,EAAE;IACF,UAAU,CAAC,KAAK,IAAI,EAAE;QACpB,wBAAW,CAAC,aAAa,EAAE,CAAC;QAE5B,MAAO,MAAM,CAAC,IAAI,CAAC,wBAAW,CAAC,OAAY,CAAS,EAAE,CAAC;IACzD,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,KAAK,IAAI,EAAE;QACnB,IAAI,KAAK,EAAE,CAAC;YACV,MAAO,KAAK,CAAC,IAAI,CAAC,wBAAW,CAAC,OAAY,CAAS,EAAE,CAAC;QACxD,CAAC;QAED,wBAAW,CAAC,cAAc,EAAE,CAAC;IAC/B,CAAC,CAAC,CAAC;AACL,CAAC,CACF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vitest-gwt",
3
- "version": "0.0.3-alpha.2",
3
+ "version": "4.0.0",
4
4
  "description": "A small library to help Vitest support given-when-then style testing without a bunch of overhead",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -9,7 +9,6 @@
9
9
  "src",
10
10
  "!**/*.spec.ts"
11
11
  ],
12
- "type": "module",
13
12
  "scripts": {
14
13
  "build": "wireit",
15
14
  "test": "wireit",
@@ -51,7 +50,7 @@
51
50
  "url": "git+https://github.com/devzeebo/vitest-gwt.git"
52
51
  },
53
52
  "peerDependencies": {
54
- "vitest": ">2.0.0"
53
+ "vitest": ">=4.0.0"
55
54
  },
56
55
  "keywords": [
57
56
  "vitest",
@@ -69,20 +68,17 @@
69
68
  },
70
69
  "homepage": "https://github.com/devzeebo/vitest-gwt#readme",
71
70
  "devDependencies": {
72
- "@react-ddd/eslint-config": "^0.3.1",
73
- "@tsconfig/node20": "^20.1.4",
74
- "@tsconfig/node22": "^22.0.0",
75
- "@types/lodash": "^4.14.198",
76
- "@types/node": "^20.6.0",
77
- "@vitest/coverage-v8": "^2.0.5",
78
- "axios": "^1.5.0",
79
- "lodash": "^4.17.21",
80
- "typescript": "^5.2.2",
81
- "vitest": ">2.0.0",
82
- "wireit": "^0.13.0"
71
+ "@react-ddd/eslint-config": "^0.4.0",
72
+ "@types/lodash": "^4.17.24",
73
+ "@types/node": "^25.9.1",
74
+ "@vitest/coverage-v8": "^4.1.8",
75
+ "axios": "^1.17.0",
76
+ "lodash": "^4.18.1",
77
+ "typescript": "^6.0.3",
78
+ "vitest": ">=4.1.8",
79
+ "wireit": "^0.14.12"
83
80
  },
84
81
  "dependencies": {
85
- "default-import": "^2.0.1",
86
- "gwt-runner": "^3.0.0-esm.3"
82
+ "gwt-runner": "^2.4.0"
87
83
  }
88
84
  }
package/src/index.ts CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  afterEach as vitestAfterEach,
5
5
  } from 'vitest';
6
6
  import gwtRunner, { TestContext } from 'gwt-runner';
7
- import withAspectBuilder from './withAspect.js';
7
+ import withAspectBuilder from './withAspect';
8
8
 
9
9
  export default gwtRunner(vitest);
10
10
  export { TestContext };
package/src/withAspect.ts CHANGED
@@ -4,13 +4,13 @@ import type {
4
4
  } from 'vitest';
5
5
  import { TestContext } from 'gwt-runner';
6
6
 
7
- type Callback<T,> = (this: T) => any;
7
+ type Callback<T> = (this: T) => any;
8
8
 
9
9
  export default (
10
10
  beforeEach: typeof vitestBeforeEach,
11
11
  afterEach: typeof vitestAfterEach,
12
12
  ) => (
13
- <T,>(
13
+ <T>(
14
14
  before: Callback<T>,
15
15
  after?: Callback<T>,
16
16
  ) => {