@effectionx/bdd 0.1.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.
Files changed (40) hide show
  1. package/README.md +171 -0
  2. package/esm/_dnt.shims.d.ts +2 -0
  3. package/esm/_dnt.shims.d.ts.map +1 -0
  4. package/esm/_dnt.shims.js +57 -0
  5. package/esm/deps/jsr.io/@std/assert/1.0.14/assertion_error.d.ts +26 -0
  6. package/esm/deps/jsr.io/@std/assert/1.0.14/assertion_error.d.ts.map +1 -0
  7. package/esm/deps/jsr.io/@std/assert/1.0.14/assertion_error.js +30 -0
  8. package/esm/deps/jsr.io/@std/internal/1.0.10/assertion_state.d.ts +150 -0
  9. package/esm/deps/jsr.io/@std/internal/1.0.10/assertion_state.d.ts.map +1 -0
  10. package/esm/deps/jsr.io/@std/internal/1.0.10/assertion_state.js +237 -0
  11. package/esm/deps/jsr.io/@std/testing/1.0.15/_test_suite.d.ts +78 -0
  12. package/esm/deps/jsr.io/@std/testing/1.0.15/_test_suite.d.ts.map +1 -0
  13. package/esm/deps/jsr.io/@std/testing/1.0.15/_test_suite.js +385 -0
  14. package/esm/deps/jsr.io/@std/testing/1.0.15/bdd.d.ts +336 -0
  15. package/esm/deps/jsr.io/@std/testing/1.0.15/bdd.d.ts.map +1 -0
  16. package/esm/deps/jsr.io/@std/testing/1.0.15/bdd.js +1057 -0
  17. package/esm/mod.d.ts +13 -0
  18. package/esm/mod.d.ts.map +1 -0
  19. package/esm/mod.js +47 -0
  20. package/esm/package.json +3 -0
  21. package/package.json +31 -0
  22. package/script/_dnt.shims.d.ts +2 -0
  23. package/script/_dnt.shims.d.ts.map +1 -0
  24. package/script/_dnt.shims.js +60 -0
  25. package/script/deps/jsr.io/@std/assert/1.0.14/assertion_error.d.ts +26 -0
  26. package/script/deps/jsr.io/@std/assert/1.0.14/assertion_error.d.ts.map +1 -0
  27. package/script/deps/jsr.io/@std/assert/1.0.14/assertion_error.js +34 -0
  28. package/script/deps/jsr.io/@std/internal/1.0.10/assertion_state.d.ts +150 -0
  29. package/script/deps/jsr.io/@std/internal/1.0.10/assertion_state.d.ts.map +1 -0
  30. package/script/deps/jsr.io/@std/internal/1.0.10/assertion_state.js +275 -0
  31. package/script/deps/jsr.io/@std/testing/1.0.15/_test_suite.d.ts +78 -0
  32. package/script/deps/jsr.io/@std/testing/1.0.15/_test_suite.d.ts.map +1 -0
  33. package/script/deps/jsr.io/@std/testing/1.0.15/_test_suite.js +389 -0
  34. package/script/deps/jsr.io/@std/testing/1.0.15/bdd.d.ts +336 -0
  35. package/script/deps/jsr.io/@std/testing/1.0.15/bdd.d.ts.map +1 -0
  36. package/script/deps/jsr.io/@std/testing/1.0.15/bdd.js +1068 -0
  37. package/script/mod.d.ts +13 -0
  38. package/script/mod.d.ts.map +1 -0
  39. package/script/mod.js +52 -0
  40. package/script/package.json +3 -0
@@ -0,0 +1,13 @@
1
+ import type { Operation } from "effection";
2
+ export declare function describe(name: string, body: () => void): void;
3
+ export declare namespace describe {
4
+ var skip: <T>(...args: import("./deps/jsr.io/@std/testing/1.0.15/bdd.js").DescribeArgs<T>) => import("./deps/jsr.io/@std/testing/1.0.15/_test_suite.js").TestSuite<T>;
5
+ var only: <T>(...args: import("./deps/jsr.io/@std/testing/1.0.15/bdd.js").DescribeArgs<T>) => import("./deps/jsr.io/@std/testing/1.0.15/_test_suite.js").TestSuite<T>;
6
+ }
7
+ export declare function beforeEach(body: () => Operation<void>): void;
8
+ export declare function it(desc: string, body?: () => Operation<void>): void;
9
+ export declare namespace it {
10
+ var skip: (desc: string, body?: (() => Operation<void>) | undefined) => ReturnType<typeof it>;
11
+ var only: (desc: string, body: () => Operation<void>) => void;
12
+ }
13
+ //# sourceMappingURL=mod.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAS3C,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,IAAI,QAYtD;yBAZe,QAAQ;;;;AAiBxB,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,SAAS,CAAC,IAAI,CAAC,QAErD;AAED,wBAAgB,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,SAAS,CAAC,IAAI,CAAC,GAAG,IAAI,CAYnE;yBAZe,EAAE;2CAA4B,SAAS,CAAC,IAAI,CAAC,kBAcjB,UAAU,CAAC,OAAO,EAAE,CAAC;qBAKhD,MAAM,QAAQ,MAAM,SAAS,CAAC,IAAI,CAAC,KAAG,IAAI"}
package/script/mod.js ADDED
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.describe = describe;
4
+ exports.beforeEach = beforeEach;
5
+ exports.it = it;
6
+ const test_adapter_1 = require("@effectionx/test-adapter");
7
+ const bdd_js_1 = require("./deps/jsr.io/@std/testing/1.0.15/bdd.js");
8
+ let current;
9
+ function describe(name, body) {
10
+ const original = current;
11
+ try {
12
+ const child = current = (0, test_adapter_1.createTestAdapter)({ name, parent: original });
13
+ (0, bdd_js_1.describe)(name, () => {
14
+ (0, bdd_js_1.afterAll)(() => child.destroy());
15
+ body();
16
+ });
17
+ }
18
+ finally {
19
+ current = original;
20
+ }
21
+ }
22
+ describe.skip = bdd_js_1.describe.skip;
23
+ describe.only = bdd_js_1.describe.only;
24
+ function beforeEach(body) {
25
+ current?.addSetup(body);
26
+ }
27
+ function it(desc, body) {
28
+ const adapter = current;
29
+ if (!body) {
30
+ bdd_js_1.it.skip(desc, () => { });
31
+ return;
32
+ }
33
+ (0, bdd_js_1.it)(desc, async () => {
34
+ const result = await adapter.runTest(body);
35
+ if (!result.ok) {
36
+ throw result.error;
37
+ }
38
+ });
39
+ }
40
+ it.skip = (...args) => {
41
+ const [desc] = args;
42
+ return bdd_js_1.it.skip(desc, () => { });
43
+ };
44
+ it.only = (desc, body) => {
45
+ const adapter = current;
46
+ bdd_js_1.it.only(desc, async () => {
47
+ const result = await adapter.runTest(body);
48
+ if (!result.ok) {
49
+ throw result.error;
50
+ }
51
+ });
52
+ };
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }