@effectionx/bdd 0.3.0 → 0.4.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 (67) hide show
  1. package/bdd.test.ts +12 -0
  2. package/bdd.ts +124 -0
  3. package/dist/bdd.d.ts +41 -0
  4. package/dist/bdd.d.ts.map +1 -0
  5. package/dist/bdd.js +77 -0
  6. package/dist/mod.d.ts +2 -0
  7. package/dist/mod.d.ts.map +1 -0
  8. package/dist/mod.js +3 -0
  9. package/dist/mod.node.d.ts +10 -0
  10. package/dist/mod.node.d.ts.map +1 -0
  11. package/dist/mod.node.js +8 -0
  12. package/dist/tsconfig.tsbuildinfo +1 -0
  13. package/mod.deno.ts +128 -0
  14. package/mod.node.ts +10 -0
  15. package/mod.ts +3 -0
  16. package/package.json +20 -18
  17. package/tsconfig.json +14 -0
  18. package/esm/_dnt.shims.d.ts +0 -2
  19. package/esm/_dnt.shims.d.ts.map +0 -1
  20. package/esm/_dnt.shims.js +0 -57
  21. package/esm/deps/jsr.io/@effectionx/test-adapter/0.5.1/box.d.ts +0 -4
  22. package/esm/deps/jsr.io/@effectionx/test-adapter/0.5.1/box.d.ts.map +0 -1
  23. package/esm/deps/jsr.io/@effectionx/test-adapter/0.5.1/box.js +0 -15
  24. package/esm/deps/jsr.io/@effectionx/test-adapter/0.5.1/mod.d.ts +0 -77
  25. package/esm/deps/jsr.io/@effectionx/test-adapter/0.5.1/mod.d.ts.map +0 -1
  26. package/esm/deps/jsr.io/@effectionx/test-adapter/0.5.1/mod.js +0 -89
  27. package/esm/deps/jsr.io/@std/assert/1.0.16/assertion_error.d.ts +0 -26
  28. package/esm/deps/jsr.io/@std/assert/1.0.16/assertion_error.d.ts.map +0 -1
  29. package/esm/deps/jsr.io/@std/assert/1.0.16/assertion_error.js +0 -30
  30. package/esm/deps/jsr.io/@std/internal/1.0.12/assertion_state.d.ts +0 -150
  31. package/esm/deps/jsr.io/@std/internal/1.0.12/assertion_state.d.ts.map +0 -1
  32. package/esm/deps/jsr.io/@std/internal/1.0.12/assertion_state.js +0 -237
  33. package/esm/deps/jsr.io/@std/testing/1.0.16/_test_suite.d.ts +0 -78
  34. package/esm/deps/jsr.io/@std/testing/1.0.16/_test_suite.d.ts.map +0 -1
  35. package/esm/deps/jsr.io/@std/testing/1.0.16/_test_suite.js +0 -385
  36. package/esm/deps/jsr.io/@std/testing/1.0.16/bdd.d.ts +0 -336
  37. package/esm/deps/jsr.io/@std/testing/1.0.16/bdd.d.ts.map +0 -1
  38. package/esm/deps/jsr.io/@std/testing/1.0.16/bdd.js +0 -1057
  39. package/esm/mod.d.ts +0 -26
  40. package/esm/mod.d.ts.map +0 -1
  41. package/esm/mod.js +0 -78
  42. package/esm/package.json +0 -3
  43. package/script/_dnt.shims.d.ts +0 -2
  44. package/script/_dnt.shims.d.ts.map +0 -1
  45. package/script/_dnt.shims.js +0 -60
  46. package/script/deps/jsr.io/@effectionx/test-adapter/0.5.1/box.d.ts +0 -4
  47. package/script/deps/jsr.io/@effectionx/test-adapter/0.5.1/box.d.ts.map +0 -1
  48. package/script/deps/jsr.io/@effectionx/test-adapter/0.5.1/box.js +0 -19
  49. package/script/deps/jsr.io/@effectionx/test-adapter/0.5.1/mod.d.ts +0 -77
  50. package/script/deps/jsr.io/@effectionx/test-adapter/0.5.1/mod.d.ts.map +0 -1
  51. package/script/deps/jsr.io/@effectionx/test-adapter/0.5.1/mod.js +0 -92
  52. package/script/deps/jsr.io/@std/assert/1.0.16/assertion_error.d.ts +0 -26
  53. package/script/deps/jsr.io/@std/assert/1.0.16/assertion_error.d.ts.map +0 -1
  54. package/script/deps/jsr.io/@std/assert/1.0.16/assertion_error.js +0 -34
  55. package/script/deps/jsr.io/@std/internal/1.0.12/assertion_state.d.ts +0 -150
  56. package/script/deps/jsr.io/@std/internal/1.0.12/assertion_state.d.ts.map +0 -1
  57. package/script/deps/jsr.io/@std/internal/1.0.12/assertion_state.js +0 -275
  58. package/script/deps/jsr.io/@std/testing/1.0.16/_test_suite.d.ts +0 -78
  59. package/script/deps/jsr.io/@std/testing/1.0.16/_test_suite.d.ts.map +0 -1
  60. package/script/deps/jsr.io/@std/testing/1.0.16/_test_suite.js +0 -389
  61. package/script/deps/jsr.io/@std/testing/1.0.16/bdd.d.ts +0 -336
  62. package/script/deps/jsr.io/@std/testing/1.0.16/bdd.d.ts.map +0 -1
  63. package/script/deps/jsr.io/@std/testing/1.0.16/bdd.js +0 -1068
  64. package/script/mod.d.ts +0 -26
  65. package/script/mod.d.ts.map +0 -1
  66. package/script/mod.js +0 -84
  67. package/script/package.json +0 -3
package/script/mod.d.ts DELETED
@@ -1,26 +0,0 @@
1
- import type { Operation } from "effection";
2
- /**
3
- * Sanitization options for test cases and test suites.
4
- * These options control Deno's test sanitizers.
5
- */
6
- export interface SanitizeOptions {
7
- /** Ensure the test case does not prematurely cause the process to exit. Defaults to true. */
8
- sanitizeExit?: boolean;
9
- /** Check that the number of async completed ops after the test is the same as number of dispatched ops. Defaults to true. */
10
- sanitizeOps?: boolean;
11
- /** Ensure the test case does not "leak" resources - ie. the resource table after the test has exactly the same contents as before the test. Defaults to true. */
12
- sanitizeResources?: boolean;
13
- }
14
- export declare function describe(name: string, body: () => void, options?: SanitizeOptions): void;
15
- export declare namespace describe {
16
- var skip: <T>(...args: import("./deps/jsr.io/@std/testing/1.0.16/bdd.js").DescribeArgs<T>) => import("./deps/jsr.io/@std/testing/1.0.16/_test_suite.js").TestSuite<T>;
17
- var only: (name: string, body: () => void, options?: SanitizeOptions) => void;
18
- }
19
- export declare function beforeAll(body: () => Operation<void>): void;
20
- export declare function beforeEach(body: () => Operation<void>): void;
21
- export declare function it(desc: string, body?: () => Operation<void>, options?: SanitizeOptions): void;
22
- export declare namespace it {
23
- var skip: (desc: string, body?: (() => Operation<void>) | undefined, options?: SanitizeOptions | undefined) => ReturnType<typeof it>;
24
- var only: (desc: string, body: () => Operation<void>, options?: SanitizeOptions) => void;
25
- }
26
- //# sourceMappingURL=mod.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAO3C;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,6FAA6F;IAC7F,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,6HAA6H;IAC7H,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iKAAiK;IACjK,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAID,wBAAgB,QAAQ,CACtB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,IAAI,EAChB,OAAO,CAAC,EAAE,eAAe,QAiB1B;yBApBe,QAAQ;;qBAwBhB,MAAM,QACN,MAAM,IAAI,YACN,eAAe,KACxB,IAAI;;AAkBP,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,SAAS,CAAC,IAAI,CAAC,QAEpD;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,SAAS,CAAC,IAAI,CAAC,QAErD;AAED,wBAAgB,EAAE,CAChB,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE,MAAM,SAAS,CAAC,IAAI,CAAC,EAC5B,OAAO,CAAC,EAAE,eAAe,GACxB,IAAI,CAgBN;yBApBe,EAAE;2CAEH,SAAS,CAAC,IAAI,CAAC,yDAoBc,UAAU,CAAC,OAAO,EAAE,CAAC;qBAMzD,MAAM,QACN,MAAM,SAAS,CAAC,IAAI,CAAC,YACjB,eAAe,KACxB,IAAI"}
package/script/mod.js DELETED
@@ -1,84 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.describe = describe;
4
- exports.beforeAll = beforeAll;
5
- exports.beforeEach = beforeEach;
6
- exports.it = it;
7
- const mod_js_1 = require("./deps/jsr.io/@effectionx/test-adapter/0.5.1/mod.js");
8
- const bdd_js_1 = require("./deps/jsr.io/@std/testing/1.0.16/bdd.js");
9
- let current;
10
- function describe(name, body, options) {
11
- const original = current;
12
- try {
13
- const child = current = (0, mod_js_1.createTestAdapter)({ name, parent: original });
14
- (0, bdd_js_1.describe)({
15
- name,
16
- fn: () => {
17
- (0, bdd_js_1.afterAll)(() => child.destroy());
18
- body();
19
- },
20
- ...options,
21
- });
22
- }
23
- finally {
24
- current = original;
25
- }
26
- }
27
- describe.skip = bdd_js_1.describe.skip;
28
- describe.only = function (name, body, options) {
29
- const original = current;
30
- try {
31
- const child = current = (0, mod_js_1.createTestAdapter)({ name, parent: original });
32
- bdd_js_1.describe.only({
33
- name,
34
- fn: () => {
35
- (0, bdd_js_1.afterAll)(() => child.destroy());
36
- body();
37
- },
38
- ...options,
39
- });
40
- }
41
- finally {
42
- current = original;
43
- }
44
- };
45
- function beforeAll(body) {
46
- current?.addOnetimeSetup(body);
47
- }
48
- function beforeEach(body) {
49
- current?.addSetup(body);
50
- }
51
- function it(desc, body, options) {
52
- const adapter = current;
53
- if (!body) {
54
- bdd_js_1.it.skip(desc, () => { });
55
- return;
56
- }
57
- (0, bdd_js_1.it)({
58
- name: desc,
59
- fn: async () => {
60
- const result = await adapter.runTest(body);
61
- if (!result.ok) {
62
- throw result.error;
63
- }
64
- },
65
- ...options,
66
- });
67
- }
68
- it.skip = (...args) => {
69
- const [desc] = args;
70
- return bdd_js_1.it.skip(desc, () => { });
71
- };
72
- it.only = (desc, body, options) => {
73
- const adapter = current;
74
- bdd_js_1.it.only({
75
- name: desc,
76
- fn: async () => {
77
- const result = await adapter.runTest(body);
78
- if (!result.ok) {
79
- throw result.error;
80
- }
81
- },
82
- ...options,
83
- });
84
- };
@@ -1,3 +0,0 @@
1
- {
2
- "type": "commonjs"
3
- }