@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/package.json CHANGED
@@ -1,30 +1,32 @@
1
1
  {
2
2
  "name": "@effectionx/bdd",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
+ "type": "module",
5
+ "main": "./dist/mod.js",
6
+ "types": "./dist/mod.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "development": "./mod.ts",
10
+ "default": "./dist/mod.js"
11
+ }
12
+ },
13
+ "peerDependencies": {
14
+ "effection": "^3 || ^4"
15
+ },
16
+ "dependencies": {
17
+ "@effectionx/test-adapter": "workspace:*"
18
+ },
19
+ "license": "MIT",
4
20
  "author": "engineering@frontside.com",
5
21
  "repository": {
6
22
  "type": "git",
7
23
  "url": "git+https://github.com/thefrontside/effectionx.git"
8
24
  },
9
- "license": "MIT",
10
25
  "bugs": {
11
26
  "url": "https://github.com/thefrontside/effectionx/issues"
12
27
  },
13
- "main": "./script/mod.js",
14
- "module": "./esm/mod.js",
15
- "exports": {
16
- ".": {
17
- "import": "./esm/mod.js",
18
- "require": "./script/mod.js"
19
- }
20
- },
21
- "scripts": {},
22
28
  "engines": {
23
- "node": ">= 16"
24
- },
25
- "sideEffects": false,
26
- "dependencies": {
27
- "effection": "^3 || ^4.0.0-0"
29
+ "node": ">= 22"
28
30
  },
29
- "_generatedBy": "dnt@dev"
30
- }
31
+ "sideEffects": false
32
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,14 @@
1
+ {
2
+ "extends": "../tsconfig.json",
3
+ "compilerOptions": {
4
+ "outDir": "dist",
5
+ "rootDir": "."
6
+ },
7
+ "include": ["**/*.ts"],
8
+ "exclude": ["**/*.test.ts", "mod.deno.ts", "dist"],
9
+ "references": [
10
+ {
11
+ "path": "../test-adapter"
12
+ }
13
+ ]
14
+ }
@@ -1,2 +0,0 @@
1
- export declare const dntGlobalThis: Omit<typeof globalThis, never>;
2
- //# sourceMappingURL=_dnt.shims.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_dnt.shims.d.ts","sourceRoot":"","sources":["../src/_dnt.shims.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,gCAA2C,CAAC"}
package/esm/_dnt.shims.js DELETED
@@ -1,57 +0,0 @@
1
- const dntGlobals = {};
2
- export const dntGlobalThis = createMergeProxy(globalThis, dntGlobals);
3
- function createMergeProxy(baseObj, extObj) {
4
- return new Proxy(baseObj, {
5
- get(_target, prop, _receiver) {
6
- if (prop in extObj) {
7
- return extObj[prop];
8
- }
9
- else {
10
- return baseObj[prop];
11
- }
12
- },
13
- set(_target, prop, value) {
14
- if (prop in extObj) {
15
- delete extObj[prop];
16
- }
17
- baseObj[prop] = value;
18
- return true;
19
- },
20
- deleteProperty(_target, prop) {
21
- let success = false;
22
- if (prop in extObj) {
23
- delete extObj[prop];
24
- success = true;
25
- }
26
- if (prop in baseObj) {
27
- delete baseObj[prop];
28
- success = true;
29
- }
30
- return success;
31
- },
32
- ownKeys(_target) {
33
- const baseKeys = Reflect.ownKeys(baseObj);
34
- const extKeys = Reflect.ownKeys(extObj);
35
- const extKeysSet = new Set(extKeys);
36
- return [...baseKeys.filter((k) => !extKeysSet.has(k)), ...extKeys];
37
- },
38
- defineProperty(_target, prop, desc) {
39
- if (prop in extObj) {
40
- delete extObj[prop];
41
- }
42
- Reflect.defineProperty(baseObj, prop, desc);
43
- return true;
44
- },
45
- getOwnPropertyDescriptor(_target, prop) {
46
- if (prop in extObj) {
47
- return Reflect.getOwnPropertyDescriptor(extObj, prop);
48
- }
49
- else {
50
- return Reflect.getOwnPropertyDescriptor(baseObj, prop);
51
- }
52
- },
53
- has(_target, prop) {
54
- return prop in extObj || prop in baseObj;
55
- },
56
- });
57
- }
@@ -1,4 +0,0 @@
1
- import { type Operation, type Result } from "effection";
2
- export declare function box<T>(content: () => Operation<T>): Operation<Result<T>>;
3
- export declare function unbox<T>(result: Result<T>): T;
4
- //# sourceMappingURL=box.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"box.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@effectionx/test-adapter/0.5.1/box.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,SAAS,EAAE,KAAK,MAAM,EAAE,MAAM,WAAW,CAAC;AAEjE,wBAAiB,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAMzE;AAED,wBAAgB,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAK7C"}
@@ -1,15 +0,0 @@
1
- import { Err, Ok } from "effection";
2
- export function* box(content) {
3
- try {
4
- return Ok(yield* content());
5
- }
6
- catch (error) {
7
- return Err(error);
8
- }
9
- }
10
- export function unbox(result) {
11
- if (result.ok) {
12
- return result.value;
13
- }
14
- throw result.error;
15
- }
@@ -1,77 +0,0 @@
1
- import type { Future, Operation, Result, Scope } from "effection";
2
- export interface TestOperation {
3
- (): Operation<void>;
4
- }
5
- export interface TestAdapter {
6
- /**
7
- * The parent of this adapter. All of the setup from this adapter will be
8
- * run in addition to the setup of this adapter during `runTest()`
9
- */
10
- readonly parent?: TestAdapter;
11
- /**
12
- * The name of this adapter which is mostly useful for debugging purposes
13
- */
14
- readonly name: string;
15
- /**
16
- * A qualified name that contains not only the name of this adapter, but of all its
17
- * ancestors. E.g. `All Tests > File System > write`
18
- */
19
- readonly fullname: string;
20
- /**
21
- * A list of this test adapter and every adapter that it descends from.
22
- */
23
- readonly lineage: Array<TestAdapter>;
24
- /**
25
- * The setup operations that will be run by this test adapter. It only includes those
26
- * setups that are associated with this adapter, not those of its ancestors.
27
- */
28
- readonly setup: {
29
- all: TestOperation[];
30
- each: TestOperation[];
31
- };
32
- /**
33
- * Add a setup operation to every test that is part of this adapter. In BDD integrations,
34
- * this is usually called by `beforEach()`
35
- */
36
- addSetup(op: TestOperation): void;
37
- /**
38
- * Add a setup operation that will run exactly once before any tests that are run in this
39
- * adapter. In BDD integrations, this is usually called by beforeAll()
40
- */
41
- addOnetimeSetup(op: TestOperation): void;
42
- /**
43
- * Actually run a test. This evaluates all setup operations, and then after those have completed
44
- * it runs the body of the test itself.
45
- */
46
- runTest(body: TestOperation): Future<Result<void>>;
47
- /**
48
- * Teardown this test adapter and all of the task and resources that are running inside it.
49
- * This basically destroys the Effection `Scope` associated with this adapter.
50
- */
51
- destroy(): Future<void>;
52
- /**
53
- * Used internally to prepare adapters to run test
54
- *
55
- * @ignore
56
- */
57
- ["@@init@@"](): Operation<Result<Scope>>;
58
- }
59
- export interface TestAdapterOptions {
60
- /**
61
- * The name of this test adapter which is handy for debugging.
62
- * Usually, you'll give this the same name as the current test
63
- * context. For example, when integrating with BDD, this would be
64
- * the same as
65
- */
66
- name?: string;
67
- /**
68
- * The parent test adapter. All of the setup from this adapter will be
69
- * run in addition to the setup of this adapter during `runTest()`
70
- */
71
- parent?: TestAdapter;
72
- }
73
- /**
74
- * Create a new test adapter with the given options.
75
- */
76
- export declare function createTestAdapter(options?: TestAdapterOptions): TestAdapter;
77
- //# sourceMappingURL=mod.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@effectionx/test-adapter/0.5.1/mod.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EACN,SAAS,EACT,MAAM,EACN,KAAK,EAEN,MAAM,WAAW,CAAC;AAWnB,MAAM,WAAW,aAAa;IAC5B,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC;CACrB;AAED,MAAM,WAAW,WAAW;IAC1B;;;OAGG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;IAE9B;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;IAErC;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE;QAAE,GAAG,EAAE,aAAa,EAAE,CAAC;QAAC,IAAI,EAAE,aAAa,EAAE,CAAA;KAAE,CAAC;IAEhE;;;OAGG;IACH,QAAQ,CAAC,EAAE,EAAE,aAAa,GAAG,IAAI,CAAC;IAElC;;;OAGG;IACH,eAAe,CAAC,EAAE,EAAE,aAAa,GAAG,IAAI,CAAC;IAEzC;;;OAGG;IACH,OAAO,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IAEnD;;;OAGG;IACH,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC;IAExB;;;;OAIG;IACH,CAAC,UAAU,CAAC,IAAI,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;CAC1C;AAED,MAAM,WAAW,kBAAkB;IACjC;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AASD;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,GAAE,kBAAuB,GAC/B,WAAW,CA4Fb"}
@@ -1,89 +0,0 @@
1
- import { createScope, Ok, run, suspend, useScope, withResolvers, } from "effection";
2
- import { box } from "./box.js";
3
- const anonymousNames = (function* () {
4
- let count = 1;
5
- while (true) {
6
- yield `anonymous test adapter ${count++}`;
7
- }
8
- })();
9
- /**
10
- * Create a new test adapter with the given options.
11
- */
12
- export function createTestAdapter(options = {}) {
13
- const setup = {
14
- all: [],
15
- each: [],
16
- };
17
- const { parent, name = anonymousNames.next().value } = options;
18
- let scope = undefined;
19
- let destroy = function* () { };
20
- const adapter = {
21
- parent,
22
- name,
23
- setup,
24
- get lineage() {
25
- const lineage = [adapter];
26
- for (let current = parent; current; current = current.parent) {
27
- lineage.unshift(current);
28
- }
29
- return lineage;
30
- },
31
- get fullname() {
32
- return adapter.lineage.map((adapter) => adapter.name).join(" > ");
33
- },
34
- addSetup(op) {
35
- setup.each.push(op);
36
- },
37
- addOnetimeSetup(op) {
38
- setup.all.push(op);
39
- },
40
- runTest(op) {
41
- return run(function* () {
42
- let init = yield* adapter["@@init@@"]();
43
- if (!init.ok) {
44
- return init;
45
- }
46
- let scope = init.value;
47
- const setups = adapter.lineage.reduce((all, adapter) => all.concat(adapter.setup.each), []);
48
- let test = yield* scope.spawn(() => box(function* () {
49
- for (let fn of setups) {
50
- yield* fn();
51
- }
52
- yield* op();
53
- }));
54
- return yield* test;
55
- });
56
- },
57
- *["@@init@@"]() {
58
- if (scope) {
59
- return yield* scope.operation;
60
- }
61
- scope = withResolvers();
62
- let parent = adapter.parent
63
- ? yield* adapter.parent["@@init@@"]()
64
- : Ok(createScope()[0]);
65
- if (!parent.ok) {
66
- scope.resolve(parent);
67
- return yield* scope.operation;
68
- }
69
- let task = yield* parent.value.spawn(function* () {
70
- let init = yield* box(function* () {
71
- for (let initializer of adapter.setup.all) {
72
- yield* initializer();
73
- }
74
- });
75
- if (!init.ok) {
76
- scope.resolve(init);
77
- }
78
- else {
79
- scope.resolve(Ok(yield* useScope()));
80
- yield* suspend();
81
- }
82
- });
83
- destroy = task.halt;
84
- return yield* scope.operation;
85
- },
86
- destroy: () => run(destroy),
87
- };
88
- return adapter;
89
- }
@@ -1,26 +0,0 @@
1
- /**
2
- * Error thrown when an assertion fails.
3
- *
4
- * @example Usage
5
- * ```ts ignore
6
- * import { AssertionError } from "@std/assert";
7
- *
8
- * try {
9
- * throw new AssertionError("foo", { cause: "bar" });
10
- * } catch (error) {
11
- * if (error instanceof AssertionError) {
12
- * error.message === "foo"; // true
13
- * error.cause === "bar"; // true
14
- * }
15
- * }
16
- * ```
17
- */
18
- export declare class AssertionError extends Error {
19
- /** Constructs a new instance.
20
- *
21
- * @param message The error message.
22
- * @param options Additional options. This argument is still unstable. It may change in the future release.
23
- */
24
- constructor(message: string, options?: ErrorOptions);
25
- }
26
- //# sourceMappingURL=assertion_error.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"assertion_error.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/assertion_error.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,cAAe,SAAQ,KAAK;IACvC;;;;OAIG;gBACS,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAIpD"}
@@ -1,30 +0,0 @@
1
- // Copyright 2018-2025 the Deno authors. MIT license.
2
- // This module is browser compatible.
3
- /**
4
- * Error thrown when an assertion fails.
5
- *
6
- * @example Usage
7
- * ```ts ignore
8
- * import { AssertionError } from "@std/assert";
9
- *
10
- * try {
11
- * throw new AssertionError("foo", { cause: "bar" });
12
- * } catch (error) {
13
- * if (error instanceof AssertionError) {
14
- * error.message === "foo"; // true
15
- * error.cause === "bar"; // true
16
- * }
17
- * }
18
- * ```
19
- */
20
- export class AssertionError extends Error {
21
- /** Constructs a new instance.
22
- *
23
- * @param message The error message.
24
- * @param options Additional options. This argument is still unstable. It may change in the future release.
25
- */
26
- constructor(message, options) {
27
- super(message, options);
28
- this.name = "AssertionError";
29
- }
30
- }
@@ -1,150 +0,0 @@
1
- export declare class AssertionState {
2
- #private;
3
- constructor();
4
- /**
5
- * Get the number that through `expect.assertions` api set.
6
- *
7
- * @returns the number that through `expect.assertions` api set.
8
- *
9
- * @example Usage
10
- * ```ts ignore
11
- * import { AssertionState } from "@std/internal";
12
- *
13
- * const assertionState = new AssertionState();
14
- * assertionState.assertionCount;
15
- * ```
16
- */
17
- get assertionCount(): number | undefined;
18
- /**
19
- * Get a certain number that assertions were called before.
20
- *
21
- * @returns return a certain number that assertions were called before.
22
- *
23
- * @example Usage
24
- * ```ts ignore
25
- * import { AssertionState } from "@std/internal";
26
- *
27
- * const assertionState = new AssertionState();
28
- * assertionState.assertionTriggeredCount;
29
- * ```
30
- */
31
- get assertionTriggeredCount(): number;
32
- /**
33
- * If `expect.hasAssertions` called, then through this method to update #state.assertionCheck value.
34
- *
35
- * @param val Set #state.assertionCheck's value
36
- *
37
- * @example Usage
38
- * ```ts ignore
39
- * import { AssertionState } from "@std/internal";
40
- *
41
- * const assertionState = new AssertionState();
42
- * assertionState.setAssertionCheck(true);
43
- * ```
44
- */
45
- setAssertionCheck(val: boolean): void;
46
- /**
47
- * If any matchers was called, `#state.assertionTriggered` will be set through this method.
48
- *
49
- * @param val Set #state.assertionTriggered's value
50
- *
51
- * @example Usage
52
- * ```ts ignore
53
- * import { AssertionState } from "@std/internal";
54
- *
55
- * const assertionState = new AssertionState();
56
- * assertionState.setAssertionTriggered(true);
57
- * ```
58
- */
59
- setAssertionTriggered(val: boolean): void;
60
- /**
61
- * If `expect.assertions` called, then through this method to update #state.assertionCheck value.
62
- *
63
- * @param num Set #state.assertionCount's value, for example if the value is set 2, that means
64
- * you must have two assertion matchers call in your test suite.
65
- *
66
- * @example Usage
67
- * ```ts ignore
68
- * import { AssertionState } from "@std/internal";
69
- *
70
- * const assertionState = new AssertionState();
71
- * assertionState.setAssertionCount(2);
72
- * ```
73
- */
74
- setAssertionCount(num: number): void;
75
- /**
76
- * If any matchers was called, `#state.assertionTriggeredCount` value will plus one internally.
77
- *
78
- * @example Usage
79
- * ```ts ignore
80
- * import { AssertionState } from "@std/internal";
81
- *
82
- * const assertionState = new AssertionState();
83
- * assertionState.updateAssertionTriggerCount();
84
- * ```
85
- */
86
- updateAssertionTriggerCount(): void;
87
- /**
88
- * Check Assertion internal state, if `#state.assertionCheck` is set true, but
89
- * `#state.assertionTriggered` is still false, then should throw an Assertion Error.
90
- *
91
- * @returns a boolean value, that the test suite is satisfied with the check. If not,
92
- * it should throw an AssertionError.
93
- *
94
- * @example Usage
95
- * ```ts ignore
96
- * import { AssertionState } from "@std/internal";
97
- *
98
- * const assertionState = new AssertionState();
99
- * if (assertionState.checkAssertionErrorState()) {
100
- * // throw AssertionError("");
101
- * }
102
- * ```
103
- */
104
- checkAssertionErrorState(): boolean;
105
- /**
106
- * Reset all assertion state when every test suite function ran completely.
107
- *
108
- * @example Usage
109
- * ```ts ignore
110
- * import { AssertionState } from "@std/internal";
111
- *
112
- * const assertionState = new AssertionState();
113
- * assertionState.resetAssertionState();
114
- * ```
115
- */
116
- resetAssertionState(): void;
117
- /**
118
- * Check Assertion called state, if `#state.assertionCount` is set to a number value, but
119
- * `#state.assertionTriggeredCount` is less then it, then should throw an assertion error.
120
- *
121
- * @returns a boolean value, that the test suite is satisfied with the check. If not,
122
- * it should throw an AssertionError.
123
- *
124
- * @example Usage
125
- * ```ts ignore
126
- * import { AssertionState } from "@std/internal";
127
- *
128
- * const assertionState = new AssertionState();
129
- * if (assertionState.checkAssertionCountSatisfied()) {
130
- * // throw AssertionError("");
131
- * }
132
- * ```
133
- */
134
- checkAssertionCountSatisfied(): boolean;
135
- }
136
- /**
137
- * return an instance of AssertionState
138
- *
139
- * @returns AssertionState
140
- *
141
- * @example Usage
142
- * ```ts ignore
143
- * import { getAssertionState } from "@std/internal";
144
- *
145
- * const assertionState = getAssertionState();
146
- * assertionState.setAssertionTriggered(true);
147
- * ```
148
- */
149
- export declare function getAssertionState(): AssertionState;
150
- //# sourceMappingURL=assertion_state.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"assertion_state.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/internal/1.0.12/assertion_state.ts"],"names":[],"mappings":"AAeA,qBAAa,cAAc;;;IAgDzB;;;;;;;;;;;;OAYG;IACH,IAAI,cAAc,IAAI,MAAM,GAAG,SAAS,CAEvC;IAED;;;;;;;;;;;;OAYG;IACH,IAAI,uBAAuB,IAAI,MAAM,CAEpC;IAED;;;;;;;;;;;;OAYG;IACH,iBAAiB,CAAC,GAAG,EAAE,OAAO;IAI9B;;;;;;;;;;;;OAYG;IACH,qBAAqB,CAAC,GAAG,EAAE,OAAO;IAIlC;;;;;;;;;;;;;OAaG;IACH,iBAAiB,CAAC,GAAG,EAAE,MAAM;IAI7B;;;;;;;;;;OAUG;IACH,2BAA2B;IAM3B;;;;;;;;;;;;;;;;OAgBG;IACH,wBAAwB,IAAI,OAAO;IAInC;;;;;;;;;;OAUG;IACH,mBAAmB,IAAI,IAAI;IAS3B;;;;;;;;;;;;;;;;OAgBG;IACH,4BAA4B,IAAI,OAAO;CAIxC;AAID;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,IAAI,cAAc,CAElD"}