veryfront 0.1.324 → 0.1.327
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/esm/cli/commands/extension/init-command.js +2 -2
- package/esm/cli/commands/extension/validate-command.js +1 -1
- package/esm/deno.d.ts +7 -0
- package/esm/deno.js +8 -1
- package/esm/deps/esm.sh/react-dom@19.2.4/client.d.ts +2 -0
- package/esm/deps/esm.sh/react-dom@19.2.4/client.d.ts.map +1 -0
- package/esm/deps/esm.sh/react-dom@19.2.4/client.js +5 -0
- package/esm/deps/esm.sh/scheduler@^0.27.0.d.ts +2 -0
- package/esm/deps/esm.sh/scheduler@^0.27.0.d.ts.map +1 -0
- package/esm/deps/esm.sh/scheduler@^0.27.0.js +3 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/almost_equals.d.ts +30 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/almost_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/almost_equals.js +47 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/array_includes.d.ts +29 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/array_includes.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/array_includes.js +65 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/assert.d.ts +17 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/assert.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/assert.js +23 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/assertion_error.d.ts +26 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/assertion_error.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/assertion_error.js +30 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/equal.d.ts +25 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/equal.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/equal.js +194 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/equals.d.ts +37 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/equals.js +61 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/exists.d.ts +18 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/exists.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/exists.js +27 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/fail.d.ts +15 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/fail.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/fail.js +20 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/false.d.ts +19 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/false.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/false.js +23 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/greater.d.ts +20 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/greater.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/greater.js +29 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/greater_or_equal.d.ts +20 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/greater_or_equal.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/greater_or_equal.js +29 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/instance_of.d.ts +23 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/instance_of.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/instance_of.js +52 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/is_error.d.ts +25 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/is_error.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/is_error.js +53 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/less.d.ts +19 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/less.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/less.js +28 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/less_or_equal.d.ts +20 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/less_or_equal.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/less_or_equal.js +29 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/match.d.ts +18 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/match.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/match.js +26 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/mod.d.ts +44 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/mod.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/mod.js +45 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/not_equals.d.ts +27 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/not_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/not_equals.js +39 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/not_instance_of.d.ts +20 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/not_instance_of.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/not_instance_of.js +29 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/not_match.d.ts +18 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/not_match.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/not_match.js +26 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/not_strict_equals.d.ts +23 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/not_strict_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/not_strict_equals.js +32 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/object_match.d.ts +29 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/object_match.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/object_match.js +177 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/rejects.d.ts +42 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/rejects.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/rejects.js +53 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/strict_equals.d.ts +24 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/strict_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/strict_equals.js +58 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/string_includes.d.ts +18 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/string_includes.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/string_includes.js +26 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/throws.d.ts +45 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/throws.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/throws.js +44 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/unimplemented.d.ts +15 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/unimplemented.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/unimplemented.js +20 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/unreachable.d.ts +15 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/unreachable.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/unreachable.js +20 -0
- package/esm/deps/jsr.io/@std/internal/1.0.13/assertion_state.d.ts +150 -0
- package/esm/deps/jsr.io/@std/internal/1.0.13/assertion_state.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.13/assertion_state.js +224 -0
- package/esm/deps/jsr.io/@std/internal/1.0.13/build_message.d.ts +80 -0
- package/esm/deps/jsr.io/@std/internal/1.0.13/build_message.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.13/build_message.js +116 -0
- package/esm/deps/jsr.io/@std/internal/1.0.13/diff.d.ts +140 -0
- package/esm/deps/jsr.io/@std/internal/1.0.13/diff.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.13/diff.js +276 -0
- package/esm/deps/jsr.io/@std/internal/1.0.13/diff_str.d.ts +99 -0
- package/esm/deps/jsr.io/@std/internal/1.0.13/diff_str.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.13/diff_str.js +182 -0
- package/esm/deps/jsr.io/@std/internal/1.0.13/format.d.ts +29 -0
- package/esm/deps/jsr.io/@std/internal/1.0.13/format.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.13/format.js +70 -0
- package/esm/deps/jsr.io/@std/internal/1.0.13/styles.d.ts +159 -0
- package/esm/deps/jsr.io/@std/internal/1.0.13/styles.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.13/styles.js +207 -0
- package/esm/deps/jsr.io/@std/internal/1.0.13/types.d.ts +25 -0
- package/esm/deps/jsr.io/@std/internal/1.0.13/types.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.13/types.js +3 -0
- package/esm/deps/jsr.io/@std/testing/1.0.18/_test_suite.d.ts +80 -0
- package/esm/deps/jsr.io/@std/testing/1.0.18/_test_suite.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/testing/1.0.18/_test_suite.js +348 -0
- package/esm/deps/jsr.io/@std/testing/1.0.18/bdd.d.ts +738 -0
- package/esm/deps/jsr.io/@std/testing/1.0.18/bdd.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/testing/1.0.18/bdd.js +656 -0
- package/esm/src/agent/fork-runtime-stream.d.ts +143 -0
- package/esm/src/agent/fork-runtime-stream.d.ts.map +1 -0
- package/esm/src/agent/fork-runtime-stream.js +505 -0
- package/esm/src/agent/hosted-child-fork-stream-execution.d.ts +130 -0
- package/esm/src/agent/hosted-child-fork-stream-execution.d.ts.map +1 -0
- package/esm/src/agent/hosted-child-fork-stream-execution.js +391 -0
- package/esm/src/agent/index.d.ts +2 -0
- package/esm/src/agent/index.d.ts.map +1 -1
- package/esm/src/agent/index.js +2 -0
- package/esm/src/chat/conversation.d.ts +5 -5
- package/esm/src/chat/final-step-fallback.js +2 -2
- package/esm/src/modules/index.d.ts +12 -0
- package/esm/src/modules/index.d.ts.map +1 -0
- package/esm/src/modules/index.js +10 -0
- package/esm/src/modules/module-resolver.d.ts +28 -0
- package/esm/src/modules/module-resolver.d.ts.map +1 -0
- package/esm/src/modules/module-resolver.js +106 -0
- package/esm/src/rendering/cleanup.d.ts +7 -0
- package/esm/src/rendering/cleanup.d.ts.map +1 -0
- package/esm/src/rendering/cleanup.js +22 -0
- package/esm/src/rendering/ssr/index.d.ts +10 -0
- package/esm/src/rendering/ssr/index.d.ts.map +1 -0
- package/esm/src/rendering/ssr/index.js +8 -0
- package/esm/src/rendering/ssr/mdx-module-loader.d.ts +5 -0
- package/esm/src/rendering/ssr/mdx-module-loader.d.ts.map +1 -0
- package/esm/src/rendering/ssr/mdx-module-loader.js +150 -0
- package/esm/src/rendering/ssr/mdx-renderer.d.ts +4 -0
- package/esm/src/rendering/ssr/mdx-renderer.d.ts.map +1 -0
- package/esm/src/rendering/ssr/mdx-renderer.js +44 -0
- package/esm/src/rendering/ssr/types.d.ts +13 -0
- package/esm/src/rendering/ssr/types.d.ts.map +1 -0
- package/esm/src/rendering/ssr/types.js +1 -0
- package/esm/src/sandbox/index.d.ts +1 -0
- package/esm/src/sandbox/index.d.ts.map +1 -1
- package/esm/src/sandbox/index.js +1 -0
- package/esm/src/sandbox/shell-tools.d.ts +39 -0
- package/esm/src/sandbox/shell-tools.d.ts.map +1 -0
- package/esm/src/sandbox/shell-tools.js +177 -0
- package/esm/src/server/shared/index.d.ts +7 -0
- package/esm/src/server/shared/index.d.ts.map +1 -0
- package/esm/src/server/shared/index.js +6 -0
- package/esm/src/testing/assert.d.ts +22 -0
- package/esm/src/testing/assert.d.ts.map +1 -0
- package/esm/src/testing/assert.js +217 -0
- package/esm/src/testing/bdd.d.ts +67 -0
- package/esm/src/testing/bdd.d.ts.map +1 -0
- package/esm/src/testing/bdd.js +401 -0
- package/esm/src/testing/deno-compat.d.ts +26 -0
- package/esm/src/testing/deno-compat.d.ts.map +1 -0
- package/esm/src/testing/deno-compat.js +146 -0
- package/esm/src/testing/index.d.ts +28 -0
- package/esm/src/testing/index.d.ts.map +1 -0
- package/esm/src/testing/index.js +27 -0
- package/esm/src/testing/init.d.ts +2 -0
- package/esm/src/testing/init.d.ts.map +1 -0
- package/esm/src/testing/init.js +18 -0
- package/esm/src/testing/isolation.d.ts +30 -0
- package/esm/src/testing/isolation.d.ts.map +1 -0
- package/esm/src/testing/isolation.js +151 -0
- package/esm/src/testing/timing.d.ts +4 -0
- package/esm/src/testing/timing.d.ts.map +1 -0
- package/esm/src/testing/timing.js +22 -0
- package/esm/src/testing/utils.d.ts +6 -0
- package/esm/src/testing/utils.d.ts.map +1 -0
- package/esm/src/testing/utils.js +49 -0
- package/esm/src/types/global-guards.d.ts +11 -0
- package/esm/src/types/global-guards.d.ts.map +1 -0
- package/esm/src/types/global-guards.js +12 -0
- package/esm/src/utils/cache/keys/namespace.d.ts +3 -0
- package/esm/src/utils/cache/keys/namespace.d.ts.map +1 -0
- package/esm/src/utils/cache/keys/namespace.js +19 -0
- package/esm/src/utils/clsx.d.ts +3 -3
- package/esm/src/utils/clsx.d.ts.map +1 -1
- package/esm/src/utils/clsx.js +2 -3
- package/esm/src/utils/mime-types.d.ts +0 -6
- package/esm/src/utils/mime-types.d.ts.map +1 -1
- package/esm/src/utils/mime-types.js +0 -1
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/package.json +14 -1
- package/src/cli/commands/extension/init-command.ts +2 -2
- package/src/cli/commands/extension/validate-command.ts +1 -1
- package/src/deno.js +8 -1
- package/src/deps/esm.sh/@types/react-dom@19.2.3/client.d.ts +105 -0
- package/src/deps/esm.sh/@types/react@19.2.14/global.d.ts +166 -0
- package/src/deps/esm.sh/@types/react@19.2.14/index.d.ts +4370 -0
- package/src/deps/esm.sh/@types/scheduler@0.26.0/index.d.ts +30 -0
- package/src/deps/esm.sh/csstype@3.2.3/index.d.ts +22569 -0
- package/src/deps/esm.sh/react-dom@19.2.4/client.d.ts +105 -0
- package/src/deps/esm.sh/react-dom@19.2.4/client.js +5 -0
- package/src/deps/esm.sh/scheduler@^0.27.0.d.ts +30 -0
- package/src/deps/esm.sh/scheduler@^0.27.0.js +3 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/almost_equals.ts +56 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/array_includes.ts +76 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/assert.ts +24 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/assertion_error.ts +31 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/equal.ts +226 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/equals.ts +68 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/exists.ts +31 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/fail.ts +21 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/false.ts +27 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/greater.ts +30 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/greater_or_equal.ts +36 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/instance_of.ts +64 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/is_error.ts +65 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/less.ts +29 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/less_or_equal.ts +36 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/match.ts +30 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/mod.ts +47 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/not_equals.ts +43 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/not_instance_of.ts +33 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/not_match.ts +30 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/not_strict_equals.ts +42 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/object_match.ts +224 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/rejects.ts +123 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/strict_equals.ts +68 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/string_includes.ts +30 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/throws.ts +111 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/unimplemented.ts +21 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/unreachable.ts +21 -0
- package/src/deps/jsr.io/@std/internal/1.0.13/assertion_state.ts +248 -0
- package/src/deps/jsr.io/@std/internal/1.0.13/build_message.ts +147 -0
- package/src/deps/jsr.io/@std/internal/1.0.13/diff.ts +317 -0
- package/src/deps/jsr.io/@std/internal/1.0.13/diff_str.ts +208 -0
- package/src/deps/jsr.io/@std/internal/1.0.13/format.ts +89 -0
- package/src/deps/jsr.io/@std/internal/1.0.13/styles.ts +233 -0
- package/src/deps/jsr.io/@std/internal/1.0.13/types.ts +30 -0
- package/src/deps/jsr.io/@std/testing/1.0.18/_test_suite.ts +461 -0
- package/src/deps/jsr.io/@std/testing/1.0.18/bdd.ts +1294 -0
- package/src/src/agent/fork-runtime-stream.ts +780 -0
- package/src/src/agent/hosted-child-fork-stream-execution.ts +579 -0
- package/src/src/agent/index.ts +26 -0
- package/src/src/chat/final-step-fallback.ts +2 -2
- package/src/src/modules/index.ts +43 -0
- package/src/src/modules/module-resolver.ts +145 -0
- package/src/src/rendering/cleanup.ts +27 -0
- package/src/src/rendering/ssr/index.ts +10 -0
- package/src/src/rendering/ssr/mdx-module-loader.ts +185 -0
- package/src/src/rendering/ssr/mdx-renderer.ts +66 -0
- package/src/src/rendering/ssr/types.ts +14 -0
- package/src/src/sandbox/index.ts +9 -0
- package/src/src/sandbox/shell-tools.ts +242 -0
- package/src/src/server/shared/index.ts +12 -0
- package/src/src/testing/assert.ts +352 -0
- package/src/src/testing/bdd.ts +618 -0
- package/src/src/testing/deno-compat.ts +206 -0
- package/src/src/testing/index.ts +92 -0
- package/src/src/testing/init.ts +21 -0
- package/src/src/testing/isolation.ts +177 -0
- package/src/src/testing/timing.ts +27 -0
- package/src/src/testing/utils.ts +44 -0
- package/src/src/types/global-guards.ts +21 -0
- package/src/src/utils/cache/keys/namespace.ts +25 -0
- package/src/src/utils/clsx.ts +2 -4
- package/src/src/utils/mime-types.ts +0 -2
- package/src/src/utils/version-constant.ts +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bdd.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/testing/1.0.18/bdd.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgZG;AACH,OAAO,KAAK,OAAO,MAAM,8BAA8B,CAAC;AAKxD,OAAO,EACL,KAAK,kBAAkB,EAGvB,KAAK,YAAY,EACjB,KAAK,SAAS,EAEf,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,kBAAkB,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC;AAE5D,uCAAuC;AACvC,MAAM,MAAM,MAAM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AC"}
|
|
@@ -0,0 +1,656 @@
|
|
|
1
|
+
// Copyright 2018-2026 the Deno authors. MIT license.
|
|
2
|
+
import { getAssertionState } from "../../internal/1.0.13/assertion_state.js";
|
|
3
|
+
import { AssertionError } from "../../assert/1.0.19/assertion_error.js";
|
|
4
|
+
import { globalSanitizersState, TestSuiteInternal, } from "./_test_suite.js";
|
|
5
|
+
/** Generates an ItDefinition from ItArgs. */
|
|
6
|
+
function itDefinition(...args) {
|
|
7
|
+
let [suiteOptionsOrNameOrFn, optionsOrNameOrFn, optionsOrFn, fn,] = args;
|
|
8
|
+
let suite = undefined;
|
|
9
|
+
let name;
|
|
10
|
+
let options;
|
|
11
|
+
if (typeof suiteOptionsOrNameOrFn === "object" &&
|
|
12
|
+
typeof suiteOptionsOrNameOrFn.symbol === "symbol") {
|
|
13
|
+
suite = suiteOptionsOrNameOrFn;
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
fn = optionsOrFn;
|
|
17
|
+
optionsOrFn = optionsOrNameOrFn;
|
|
18
|
+
optionsOrNameOrFn = suiteOptionsOrNameOrFn;
|
|
19
|
+
}
|
|
20
|
+
if (typeof optionsOrNameOrFn === "string") {
|
|
21
|
+
name = optionsOrNameOrFn;
|
|
22
|
+
if (typeof optionsOrFn === "function") {
|
|
23
|
+
fn = optionsOrFn;
|
|
24
|
+
options = {};
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
options = optionsOrFn;
|
|
28
|
+
if (!fn)
|
|
29
|
+
fn = options.fn;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
else if (typeof optionsOrNameOrFn === "function") {
|
|
33
|
+
fn = optionsOrNameOrFn;
|
|
34
|
+
name = fn.name;
|
|
35
|
+
options = {};
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
options = optionsOrNameOrFn;
|
|
39
|
+
if (typeof optionsOrFn === "function") {
|
|
40
|
+
fn = optionsOrFn;
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
fn = options.fn;
|
|
44
|
+
}
|
|
45
|
+
name = options.name ?? fn.name;
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
...(suite !== undefined ? { suite } : {}),
|
|
49
|
+
...options,
|
|
50
|
+
name,
|
|
51
|
+
fn,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Registers an individual test case.
|
|
56
|
+
*
|
|
57
|
+
* @example Usage
|
|
58
|
+
* ```ts ignore
|
|
59
|
+
* import { describe, it } from "@std/testing/bdd";
|
|
60
|
+
* import { assertEquals } from "@std/assert";
|
|
61
|
+
*
|
|
62
|
+
* describe("example", () => {
|
|
63
|
+
* it("should pass", () => {
|
|
64
|
+
* // test case
|
|
65
|
+
* assertEquals(2 + 2, 4);
|
|
66
|
+
* });
|
|
67
|
+
* });
|
|
68
|
+
* ```
|
|
69
|
+
*
|
|
70
|
+
* @typeParam T The self type of the function to implement the test case
|
|
71
|
+
* @param args The test case
|
|
72
|
+
*/
|
|
73
|
+
export function it(...args) {
|
|
74
|
+
if (TestSuiteInternal.runningCount > 0) {
|
|
75
|
+
throw new Error("Cannot register new test cases after already registered test cases start running");
|
|
76
|
+
}
|
|
77
|
+
const assertionState = getAssertionState();
|
|
78
|
+
const options = itDefinition(...args);
|
|
79
|
+
const { suite } = options;
|
|
80
|
+
const testSuite = suite
|
|
81
|
+
? TestSuiteInternal.suites.get(suite.symbol)
|
|
82
|
+
: TestSuiteInternal.current;
|
|
83
|
+
if (!TestSuiteInternal.started)
|
|
84
|
+
TestSuiteInternal.started = true;
|
|
85
|
+
if (testSuite) {
|
|
86
|
+
TestSuiteInternal.addStep(testSuite, options);
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
const { name, fn, ignore, only, permissions, sanitizeExit = globalSanitizersState.sanitizeExit, sanitizeOps = globalSanitizersState.sanitizeOps, sanitizeResources = globalSanitizersState.sanitizeResources, } = options;
|
|
90
|
+
const opts = {
|
|
91
|
+
name,
|
|
92
|
+
async fn(t) {
|
|
93
|
+
TestSuiteInternal.runningCount++;
|
|
94
|
+
try {
|
|
95
|
+
await fn.call({}, t);
|
|
96
|
+
}
|
|
97
|
+
finally {
|
|
98
|
+
TestSuiteInternal.runningCount--;
|
|
99
|
+
}
|
|
100
|
+
try {
|
|
101
|
+
if (assertionState.checkAssertionErrorState()) {
|
|
102
|
+
throw new AssertionError("Expected at least one assertion to be called but received none");
|
|
103
|
+
}
|
|
104
|
+
if (assertionState.checkAssertionCountSatisfied()) {
|
|
105
|
+
throw new AssertionError(`Expected exactly ${assertionState.assertionCount} ${assertionState.assertionCount === 1 ? "assertion" : "assertions"} to be called, ` +
|
|
106
|
+
`but received ${assertionState.assertionTriggeredCount}`);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
finally {
|
|
110
|
+
assertionState.resetAssertionState();
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
if (ignore !== undefined) {
|
|
115
|
+
opts.ignore = ignore;
|
|
116
|
+
}
|
|
117
|
+
if (only !== undefined) {
|
|
118
|
+
opts.only = only;
|
|
119
|
+
}
|
|
120
|
+
if (permissions !== undefined) {
|
|
121
|
+
opts.permissions = permissions;
|
|
122
|
+
}
|
|
123
|
+
if (sanitizeExit !== undefined) {
|
|
124
|
+
opts.sanitizeExit = sanitizeExit;
|
|
125
|
+
}
|
|
126
|
+
if (sanitizeOps !== undefined) {
|
|
127
|
+
opts.sanitizeOps = sanitizeOps;
|
|
128
|
+
}
|
|
129
|
+
if (sanitizeResources !== undefined) {
|
|
130
|
+
opts.sanitizeResources = sanitizeResources;
|
|
131
|
+
}
|
|
132
|
+
TestSuiteInternal.registerTest(opts);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Only execute this test case.
|
|
137
|
+
*
|
|
138
|
+
* @example Usage
|
|
139
|
+
* ```ts ignore
|
|
140
|
+
* import { describe, it } from "@std/testing/bdd";
|
|
141
|
+
* import { assertEquals } from "@std/assert";
|
|
142
|
+
*
|
|
143
|
+
* describe("example", () => {
|
|
144
|
+
* it("should pass", () => {
|
|
145
|
+
* assertEquals(2 + 2, 4);
|
|
146
|
+
* });
|
|
147
|
+
*
|
|
148
|
+
* it.only("should pass too", () => {
|
|
149
|
+
* assertEquals(3 + 4, 7);
|
|
150
|
+
* });
|
|
151
|
+
* });
|
|
152
|
+
* ```
|
|
153
|
+
*
|
|
154
|
+
* @param args The test case
|
|
155
|
+
*/
|
|
156
|
+
it.only = function itOnly(...args) {
|
|
157
|
+
const options = itDefinition(...args);
|
|
158
|
+
return it({
|
|
159
|
+
...options,
|
|
160
|
+
only: true,
|
|
161
|
+
});
|
|
162
|
+
};
|
|
163
|
+
/**
|
|
164
|
+
* Ignore this test case.
|
|
165
|
+
*
|
|
166
|
+
* @example Usage
|
|
167
|
+
* ```ts ignore
|
|
168
|
+
* import { describe, it } from "@std/testing/bdd";
|
|
169
|
+
* import { assertEquals } from "@std/assert";
|
|
170
|
+
*
|
|
171
|
+
* describe("example", () => {
|
|
172
|
+
* it("should pass", () => {
|
|
173
|
+
* assertEquals(2 + 2, 4);
|
|
174
|
+
* });
|
|
175
|
+
*
|
|
176
|
+
* it.ignore("should pass too", () => {
|
|
177
|
+
* assertEquals(3 + 4, 7);
|
|
178
|
+
* });
|
|
179
|
+
* });
|
|
180
|
+
* ```
|
|
181
|
+
*
|
|
182
|
+
* @param args The test case
|
|
183
|
+
*/
|
|
184
|
+
it.ignore = function itIgnore(...args) {
|
|
185
|
+
const options = itDefinition(...args);
|
|
186
|
+
return it({
|
|
187
|
+
...options,
|
|
188
|
+
ignore: true,
|
|
189
|
+
});
|
|
190
|
+
};
|
|
191
|
+
/** Skip this test case.
|
|
192
|
+
*
|
|
193
|
+
* @example Usage
|
|
194
|
+
* ```ts ignore
|
|
195
|
+
* import { describe, it } from "@std/testing/bdd";
|
|
196
|
+
* import { assertEquals } from "@std/assert";
|
|
197
|
+
*
|
|
198
|
+
* describe("example", () => {
|
|
199
|
+
* it("should pass", () => {
|
|
200
|
+
* assertEquals(2 + 2, 4);
|
|
201
|
+
* });
|
|
202
|
+
*
|
|
203
|
+
* it.skip("should pass too", () => {
|
|
204
|
+
* assertEquals(3 + 4, 7);
|
|
205
|
+
* });
|
|
206
|
+
* });
|
|
207
|
+
* ```
|
|
208
|
+
*
|
|
209
|
+
* @param args The test case
|
|
210
|
+
*/
|
|
211
|
+
it.skip = function itSkip(...args) {
|
|
212
|
+
it.ignore(...args);
|
|
213
|
+
};
|
|
214
|
+
/**
|
|
215
|
+
* Alias of {@linkcode it}
|
|
216
|
+
*
|
|
217
|
+
* Registers an individual test case.
|
|
218
|
+
*
|
|
219
|
+
* @example Usage
|
|
220
|
+
* ```ts ignore
|
|
221
|
+
* import { test } from "@std/testing/bdd";
|
|
222
|
+
* import { assertEquals } from "@std/assert";
|
|
223
|
+
*
|
|
224
|
+
* test("a test case", () => {
|
|
225
|
+
* // test case
|
|
226
|
+
* assertEquals(2 + 2, 4);
|
|
227
|
+
* });
|
|
228
|
+
* ```
|
|
229
|
+
*
|
|
230
|
+
* @typeParam T The self type of the function to implement the test case
|
|
231
|
+
* @param args The test case
|
|
232
|
+
*/
|
|
233
|
+
export function test(...args) {
|
|
234
|
+
it(...args);
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Only execute this test case.
|
|
238
|
+
*
|
|
239
|
+
* @example Usage
|
|
240
|
+
* ```ts ignore
|
|
241
|
+
* import { describe, test } from "@std/testing/bdd";
|
|
242
|
+
* import { assertEquals } from "@std/assert";
|
|
243
|
+
*
|
|
244
|
+
* describe("example", () => {
|
|
245
|
+
* test("should pass", () => {
|
|
246
|
+
* assertEquals(2 + 2, 4);
|
|
247
|
+
* });
|
|
248
|
+
*
|
|
249
|
+
* test.only("should pass too", () => {
|
|
250
|
+
* assertEquals(3 + 4, 7);
|
|
251
|
+
* });
|
|
252
|
+
* });
|
|
253
|
+
* ```
|
|
254
|
+
*
|
|
255
|
+
* @param args The test case
|
|
256
|
+
*/
|
|
257
|
+
test.only = function itOnly(...args) {
|
|
258
|
+
it.only(...args);
|
|
259
|
+
};
|
|
260
|
+
/**
|
|
261
|
+
* Ignore this test case.
|
|
262
|
+
*
|
|
263
|
+
* @example Usage
|
|
264
|
+
* ```ts ignore
|
|
265
|
+
* import { describe, test } from "@std/testing/bdd";
|
|
266
|
+
* import { assertEquals } from "@std/assert";
|
|
267
|
+
*
|
|
268
|
+
* describe("example", () => {
|
|
269
|
+
* test("should pass", () => {
|
|
270
|
+
* assertEquals(2 + 2, 4);
|
|
271
|
+
* });
|
|
272
|
+
*
|
|
273
|
+
* test.ignore("should pass too", () => {
|
|
274
|
+
* assertEquals(3 + 4, 7);
|
|
275
|
+
* });
|
|
276
|
+
* });
|
|
277
|
+
* ```
|
|
278
|
+
*
|
|
279
|
+
* @param args The test case
|
|
280
|
+
*/
|
|
281
|
+
test.ignore = function itIgnore(...args) {
|
|
282
|
+
it.ignore(...args);
|
|
283
|
+
};
|
|
284
|
+
/** Skip this test case.
|
|
285
|
+
*
|
|
286
|
+
* @example Usage
|
|
287
|
+
* ```ts ignore
|
|
288
|
+
* import { describe, test } from "@std/testing/bdd";
|
|
289
|
+
* import { assertEquals } from "@std/assert";
|
|
290
|
+
*
|
|
291
|
+
* describe("example", () => {
|
|
292
|
+
* test("should pass", () => {
|
|
293
|
+
* assertEquals(2 + 2, 4);
|
|
294
|
+
* });
|
|
295
|
+
*
|
|
296
|
+
* test.skip("should pass too", () => {
|
|
297
|
+
* assertEquals(3 + 4, 7);
|
|
298
|
+
* });
|
|
299
|
+
* });
|
|
300
|
+
* ```
|
|
301
|
+
*
|
|
302
|
+
* @param args The test case
|
|
303
|
+
*/
|
|
304
|
+
test.skip = function itSkip(...args) {
|
|
305
|
+
it.ignore(...args);
|
|
306
|
+
};
|
|
307
|
+
function addHook(name, fn) {
|
|
308
|
+
if (!TestSuiteInternal.current) {
|
|
309
|
+
if (TestSuiteInternal.started) {
|
|
310
|
+
throw new Error("Cannot add global hooks after a global test is registered");
|
|
311
|
+
}
|
|
312
|
+
TestSuiteInternal.current = new TestSuiteInternal({
|
|
313
|
+
name: "global",
|
|
314
|
+
[name]: fn,
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
else {
|
|
318
|
+
TestSuiteInternal.setHook(TestSuiteInternal.current, name, fn);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* Run some shared setup before all of the tests in the group.
|
|
323
|
+
* Useful for async setup in `describe` blocks. Outside them,
|
|
324
|
+
* top-level initialization code should be used instead.
|
|
325
|
+
*
|
|
326
|
+
* @example Usage
|
|
327
|
+
* ```ts ignore
|
|
328
|
+
* import { describe, it, beforeAll } from "@std/testing/bdd";
|
|
329
|
+
* import { assertEquals } from "@std/assert";
|
|
330
|
+
*
|
|
331
|
+
* beforeAll(() => {
|
|
332
|
+
* console.log("beforeAll");
|
|
333
|
+
* });
|
|
334
|
+
*
|
|
335
|
+
* describe("example", () => {
|
|
336
|
+
* it("should pass", () => {
|
|
337
|
+
* // test case
|
|
338
|
+
* assertEquals(2 + 2, 4);
|
|
339
|
+
* });
|
|
340
|
+
* });
|
|
341
|
+
* ```
|
|
342
|
+
*
|
|
343
|
+
* @typeParam T The self type of the function
|
|
344
|
+
* @param fn The function to implement the setup behavior.
|
|
345
|
+
*/
|
|
346
|
+
export function beforeAll(fn) {
|
|
347
|
+
addHook("beforeAll", fn);
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* Alias of {@linkcode beforeAll}
|
|
351
|
+
*
|
|
352
|
+
* Run some shared setup before all of the tests in the suite.
|
|
353
|
+
*
|
|
354
|
+
* @example Usage
|
|
355
|
+
* ```ts ignore
|
|
356
|
+
* import { describe, it, before } from "@std/testing/bdd";
|
|
357
|
+
* import { assertEquals } from "@std/assert";
|
|
358
|
+
*
|
|
359
|
+
* before(() => {
|
|
360
|
+
* console.log("before");
|
|
361
|
+
* });
|
|
362
|
+
*
|
|
363
|
+
* describe("example", () => {
|
|
364
|
+
* it("should pass", () => {
|
|
365
|
+
* // test case
|
|
366
|
+
* assertEquals(2 + 2, 4);
|
|
367
|
+
* });
|
|
368
|
+
* });
|
|
369
|
+
* ```
|
|
370
|
+
*
|
|
371
|
+
* @typeParam T The self type of the function
|
|
372
|
+
* @param fn The function to implement the setup behavior.
|
|
373
|
+
*/
|
|
374
|
+
export function before(fn) {
|
|
375
|
+
beforeAll(fn);
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* Run some shared teardown after all of the tests in the suite.
|
|
379
|
+
*
|
|
380
|
+
* @example Usage
|
|
381
|
+
* ```ts ignore
|
|
382
|
+
* import { describe, it, afterAll } from "@std/testing/bdd";
|
|
383
|
+
* import { assertEquals } from "@std/assert";
|
|
384
|
+
*
|
|
385
|
+
* afterAll(() => {
|
|
386
|
+
* console.log("afterAll");
|
|
387
|
+
* });
|
|
388
|
+
*
|
|
389
|
+
* describe("example", () => {
|
|
390
|
+
* it("should pass", () => {
|
|
391
|
+
* // test case
|
|
392
|
+
* assertEquals(2 + 2, 4);
|
|
393
|
+
* });
|
|
394
|
+
* });
|
|
395
|
+
* ```
|
|
396
|
+
*
|
|
397
|
+
* @typeParam T The self type of the function
|
|
398
|
+
* @param fn The function to implement the teardown behavior.
|
|
399
|
+
*/
|
|
400
|
+
export function afterAll(fn) {
|
|
401
|
+
addHook("afterAll", fn);
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* Alias of {@linkcode afterAll}.
|
|
405
|
+
*
|
|
406
|
+
* Run some shared teardown after all of the tests in the suite.
|
|
407
|
+
*
|
|
408
|
+
* @example Usage
|
|
409
|
+
* ```ts ignore
|
|
410
|
+
* import { describe, it, after } from "@std/testing/bdd";
|
|
411
|
+
* import { assertEquals } from "@std/assert";
|
|
412
|
+
*
|
|
413
|
+
* after(() => {
|
|
414
|
+
* console.log("after");
|
|
415
|
+
* });
|
|
416
|
+
*
|
|
417
|
+
* describe("example", () => {
|
|
418
|
+
* it("should pass", () => {
|
|
419
|
+
* // test case
|
|
420
|
+
* assertEquals(2 + 2, 4);
|
|
421
|
+
* });
|
|
422
|
+
* });
|
|
423
|
+
* ```
|
|
424
|
+
*
|
|
425
|
+
* @typeParam T The self type of the function
|
|
426
|
+
* @param fn The function to implement the teardown behavior.
|
|
427
|
+
*/
|
|
428
|
+
export function after(fn) {
|
|
429
|
+
afterAll(fn);
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* Run some shared setup before each test in the suite.
|
|
433
|
+
*
|
|
434
|
+
* @example Usage
|
|
435
|
+
* ```ts ignore
|
|
436
|
+
* import { describe, it, beforeEach } from "@std/testing/bdd";
|
|
437
|
+
* import { assertEquals } from "@std/assert";
|
|
438
|
+
*
|
|
439
|
+
* beforeEach(() => {
|
|
440
|
+
* console.log("beforeEach");
|
|
441
|
+
* });
|
|
442
|
+
*
|
|
443
|
+
* describe("example", () => {
|
|
444
|
+
* it("should pass", () => {
|
|
445
|
+
* // test case
|
|
446
|
+
* assertEquals(2 + 2, 4);
|
|
447
|
+
* });
|
|
448
|
+
* });
|
|
449
|
+
* ```
|
|
450
|
+
*
|
|
451
|
+
* @typeParam T The self type of the function
|
|
452
|
+
* @param fn The function to implement the shared setup behavior
|
|
453
|
+
*/
|
|
454
|
+
export function beforeEach(fn) {
|
|
455
|
+
addHook("beforeEach", fn);
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* Run some shared teardown after each test in the suite.
|
|
459
|
+
*
|
|
460
|
+
* @example Usage
|
|
461
|
+
* ```ts ignore
|
|
462
|
+
* import { describe, it, afterEach } from "@std/testing/bdd";
|
|
463
|
+
* import { assertEquals } from "@std/assert";
|
|
464
|
+
*
|
|
465
|
+
* afterEach(() => {
|
|
466
|
+
* console.log("afterEach");
|
|
467
|
+
* });
|
|
468
|
+
*
|
|
469
|
+
* describe("example", () => {
|
|
470
|
+
* it("should pass", () => {
|
|
471
|
+
* // test case
|
|
472
|
+
* assertEquals(2 + 2, 4);
|
|
473
|
+
* });
|
|
474
|
+
* });
|
|
475
|
+
* ```
|
|
476
|
+
*
|
|
477
|
+
* @typeParam T The self type of the function
|
|
478
|
+
* @param fn The function to implement the shared teardown behavior
|
|
479
|
+
*/
|
|
480
|
+
export function afterEach(fn) {
|
|
481
|
+
addHook("afterEach", fn);
|
|
482
|
+
}
|
|
483
|
+
/** Generates a DescribeDefinition from DescribeArgs. */
|
|
484
|
+
function describeDefinition(...args) {
|
|
485
|
+
let [suiteOptionsOrNameOrFn, optionsOrNameOrFn, optionsOrFn, fn,] = args;
|
|
486
|
+
let suite = undefined;
|
|
487
|
+
let name;
|
|
488
|
+
let options;
|
|
489
|
+
if (typeof suiteOptionsOrNameOrFn === "object" &&
|
|
490
|
+
typeof suiteOptionsOrNameOrFn.symbol === "symbol") {
|
|
491
|
+
suite = suiteOptionsOrNameOrFn;
|
|
492
|
+
}
|
|
493
|
+
else {
|
|
494
|
+
fn = optionsOrFn;
|
|
495
|
+
optionsOrFn = optionsOrNameOrFn;
|
|
496
|
+
optionsOrNameOrFn = suiteOptionsOrNameOrFn;
|
|
497
|
+
}
|
|
498
|
+
if (typeof optionsOrNameOrFn === "string") {
|
|
499
|
+
name = optionsOrNameOrFn;
|
|
500
|
+
if (typeof optionsOrFn === "function") {
|
|
501
|
+
fn = optionsOrFn;
|
|
502
|
+
options = {};
|
|
503
|
+
}
|
|
504
|
+
else {
|
|
505
|
+
options = optionsOrFn ?? {};
|
|
506
|
+
if (fn === undefined) {
|
|
507
|
+
fn = options.fn;
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
else if (typeof optionsOrNameOrFn === "function") {
|
|
512
|
+
fn = optionsOrNameOrFn;
|
|
513
|
+
name = fn.name;
|
|
514
|
+
options = {};
|
|
515
|
+
}
|
|
516
|
+
else {
|
|
517
|
+
options = optionsOrNameOrFn ?? {};
|
|
518
|
+
if (typeof optionsOrFn === "function") {
|
|
519
|
+
fn = optionsOrFn;
|
|
520
|
+
}
|
|
521
|
+
else {
|
|
522
|
+
fn = options.fn;
|
|
523
|
+
}
|
|
524
|
+
name = options.name ?? fn?.name ?? "";
|
|
525
|
+
}
|
|
526
|
+
if (suite === undefined) {
|
|
527
|
+
suite = options.suite;
|
|
528
|
+
}
|
|
529
|
+
if (suite === undefined && TestSuiteInternal.current) {
|
|
530
|
+
const { symbol } = TestSuiteInternal.current;
|
|
531
|
+
suite = { symbol };
|
|
532
|
+
}
|
|
533
|
+
return {
|
|
534
|
+
...options,
|
|
535
|
+
suite: suite,
|
|
536
|
+
name,
|
|
537
|
+
fn: fn,
|
|
538
|
+
};
|
|
539
|
+
}
|
|
540
|
+
/**
|
|
541
|
+
* Registers a test suite.
|
|
542
|
+
*
|
|
543
|
+
* @example Usage
|
|
544
|
+
* ```ts ignore
|
|
545
|
+
* import { describe, it } from "@std/testing/bdd";
|
|
546
|
+
* import { assertEquals } from "@std/assert";
|
|
547
|
+
*
|
|
548
|
+
* describe("example", () => {
|
|
549
|
+
* it("should pass", () => {
|
|
550
|
+
* // test case
|
|
551
|
+
* assertEquals(2 + 2, 4);
|
|
552
|
+
* });
|
|
553
|
+
* });
|
|
554
|
+
* ```
|
|
555
|
+
*
|
|
556
|
+
* @typeParam T The self type of the test suite body.
|
|
557
|
+
* @param args The test suite body.
|
|
558
|
+
* @returns The test suite
|
|
559
|
+
*/
|
|
560
|
+
export function describe(...args) {
|
|
561
|
+
if (TestSuiteInternal.runningCount > 0) {
|
|
562
|
+
throw new Error("Cannot register new test suites after already registered test cases start running");
|
|
563
|
+
}
|
|
564
|
+
const options = describeDefinition(...args);
|
|
565
|
+
if (!TestSuiteInternal.started)
|
|
566
|
+
TestSuiteInternal.started = true;
|
|
567
|
+
const { symbol } = new TestSuiteInternal(options);
|
|
568
|
+
return { symbol };
|
|
569
|
+
}
|
|
570
|
+
/**
|
|
571
|
+
* Only execute this test suite.
|
|
572
|
+
*
|
|
573
|
+
* @example Usage
|
|
574
|
+
* ```ts ignore
|
|
575
|
+
* import { describe, it, beforeAll } from "@std/testing/bdd";
|
|
576
|
+
* import { assertEquals } from "@std/assert";
|
|
577
|
+
*
|
|
578
|
+
* describe("example", () => {
|
|
579
|
+
* it("should pass", () => {
|
|
580
|
+
* assertEquals(2 + 2, 4);
|
|
581
|
+
* });
|
|
582
|
+
* });
|
|
583
|
+
*
|
|
584
|
+
* // Only this test suite will run
|
|
585
|
+
* describe.only("example 2", () => {
|
|
586
|
+
* it("should pass too", () => {
|
|
587
|
+
* assertEquals(3 + 4, 7);
|
|
588
|
+
* });
|
|
589
|
+
* });
|
|
590
|
+
* ```
|
|
591
|
+
*
|
|
592
|
+
* @param args The test suite body
|
|
593
|
+
*/
|
|
594
|
+
describe.only = function describeOnly(...args) {
|
|
595
|
+
const options = describeDefinition(...args);
|
|
596
|
+
return describe({
|
|
597
|
+
...options,
|
|
598
|
+
only: true,
|
|
599
|
+
});
|
|
600
|
+
};
|
|
601
|
+
/**
|
|
602
|
+
* Ignore the test suite.
|
|
603
|
+
*
|
|
604
|
+
* @example Usage
|
|
605
|
+
* ```ts ignore
|
|
606
|
+
* import { describe, it, beforeAll } from "@std/testing/bdd";
|
|
607
|
+
* import { assertEquals } from "@std/assert";
|
|
608
|
+
*
|
|
609
|
+
* describe("example", () => {
|
|
610
|
+
* it("should pass", () => {
|
|
611
|
+
* assertEquals(2 + 2, 4);
|
|
612
|
+
* });
|
|
613
|
+
* });
|
|
614
|
+
*
|
|
615
|
+
* describe.ignore("example 2", () => {
|
|
616
|
+
* it("should pass too", () => {
|
|
617
|
+
* assertEquals(3 + 4, 7);
|
|
618
|
+
* });
|
|
619
|
+
* });
|
|
620
|
+
* ```
|
|
621
|
+
*
|
|
622
|
+
* @param args The test suite body
|
|
623
|
+
*/
|
|
624
|
+
describe.ignore = function describeIgnore(...args) {
|
|
625
|
+
const options = describeDefinition(...args);
|
|
626
|
+
return describe({
|
|
627
|
+
...options,
|
|
628
|
+
ignore: true,
|
|
629
|
+
});
|
|
630
|
+
};
|
|
631
|
+
/**
|
|
632
|
+
* Skip the test suite.
|
|
633
|
+
*
|
|
634
|
+
* @example Usage
|
|
635
|
+
* ```ts ignore
|
|
636
|
+
* import { describe, it, beforeAll } from "@std/testing/bdd";
|
|
637
|
+
* import { assertEquals } from "@std/assert";
|
|
638
|
+
*
|
|
639
|
+
* describe("example", () => {
|
|
640
|
+
* it("should pass", () => {
|
|
641
|
+
* assertEquals(2 + 2, 4);
|
|
642
|
+
* });
|
|
643
|
+
* });
|
|
644
|
+
*
|
|
645
|
+
* describe.skip("example 2", () => {
|
|
646
|
+
* it("should pass too", () => {
|
|
647
|
+
* assertEquals(3 + 4, 7);
|
|
648
|
+
* });
|
|
649
|
+
* });
|
|
650
|
+
* ```
|
|
651
|
+
*
|
|
652
|
+
* @param args The test suite body
|
|
653
|
+
*/
|
|
654
|
+
describe.skip = function describeSkip(...args) {
|
|
655
|
+
return describe.ignore(...args);
|
|
656
|
+
};
|