@goast/core 0.4.0 → 0.4.1
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/_dnt.test_polyfills.d.ts +11 -0
- package/esm/_dnt.test_polyfills.d.ts.map +1 -1
- package/esm/_dnt.test_polyfills.js +14 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/assertion_error.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.11}/assertion_error.js +1 -1
- package/esm/deps/jsr.io/@std/assert/1.0.11/false.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.11}/false.js +1 -1
- package/esm/deps/jsr.io/@std/assert/1.0.11/instance_of.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.11}/instance_of.js +1 -1
- package/esm/deps/jsr.io/@std/assert/1.0.11/match.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.11}/match.js +1 -1
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_instance_of.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.11}/not_instance_of.js +1 -1
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_match.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.11}/not_match.js +1 -1
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.11}/not_strict_equals.js +2 -2
- package/esm/deps/jsr.io/@std/assert/1.0.11/strict_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.11}/strict_equals.js +6 -6
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_assert_equals.js +2 -2
- package/{script/deps/jsr.io/@std/assert/1.0.6/is_error.d.ts → esm/deps/jsr.io/@std/expect/1.0.12/_assert_is_error.d.ts} +1 -12
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_is_error.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/{assert/1.0.6/is_error.js → expect/1.0.12/_assert_is_error.js} +8 -19
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_not_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_assert_not_equals.js +3 -3
- package/esm/deps/jsr.io/@std/expect/{1.0.5/_assertion.d.ts → 1.0.12/_assertions.d.ts} +2 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assertions.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assertions.js +13 -0
- package/esm/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_asymmetric_matchers.d.ts +14 -4
- package/esm/deps/jsr.io/@std/expect/1.0.12/_asymmetric_matchers.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_asymmetric_matchers.js +54 -17
- package/esm/deps/jsr.io/@std/expect/1.0.12/_build_message.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_build_message.js +9 -9
- package/esm/deps/jsr.io/@std/expect/1.0.12/_custom_equality_tester.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_custom_equality_tester.js +1 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_equal.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_equal.js +8 -8
- package/esm/deps/jsr.io/@std/expect/1.0.12/_extend.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_extend.js +1 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_inspect_args.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_inspect_args.js +1 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_matchers.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_matchers.js +714 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_mock_util.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_mock_util.js +1 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_serializer.d.ts +4 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_serializer.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_serializer.js +10 -0
- package/esm/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_types.d.ts +7 -2
- package/esm/deps/jsr.io/@std/expect/1.0.12/_types.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_types.js +3 -0
- package/esm/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_utils.d.ts +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_utils.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_utils.js +60 -1
- package/{script/deps/jsr.io/@std/expect/1.0.5 → esm/deps/jsr.io/@std/expect/1.0.12}/expect.d.ts +10 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/expect.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/expect.js +101 -3
- package/esm/deps/jsr.io/@std/expect/1.0.12/fn.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/fn.js +1 -1
- package/{script/deps/jsr.io/@std/expect/1.0.5 → esm/deps/jsr.io/@std/expect/1.0.12}/mod.d.ts +8 -7
- package/esm/deps/jsr.io/@std/expect/1.0.12/mod.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/mod.js +9 -8
- package/esm/deps/jsr.io/@std/internal/1.0.5/assertion_state.d.ts +160 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/assertion_state.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/assertion_state.js +199 -0
- package/esm/deps/jsr.io/@std/internal/{1.0.4 → 1.0.5}/build_message.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/internal/{1.0.4 → 1.0.5}/diff.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/internal/{1.0.4 → 1.0.5}/diff_str.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/internal/{1.0.4 → 1.0.5}/format.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/internal/{1.0.4 → 1.0.5}/styles.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/internal/{1.0.4 → 1.0.5}/types.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/testing/{1.0.3 → 1.0.9}/_test_suite.d.ts +6 -1
- package/esm/deps/jsr.io/@std/testing/1.0.9/_test_suite.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/testing/{1.0.3 → 1.0.9}/_test_suite.js +45 -5
- package/esm/deps/jsr.io/@std/testing/{1.0.3 → 1.0.9}/bdd.d.ts +12 -5
- package/{script/deps/jsr.io/@std/testing/1.0.3 → esm/deps/jsr.io/@std/testing/1.0.9}/bdd.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/testing/{1.0.3 → 1.0.9}/bdd.js +85 -7
- package/esm/src/collect/helpers.test.js +2 -2
- package/esm/src/transform/helpers.test.js +2 -2
- package/esm/src/utils/action-provider.test.js +2 -2
- package/esm/src/utils/asset-manager.d.ts +1 -0
- package/esm/src/utils/asset-manager.d.ts.map +1 -1
- package/esm/src/utils/asset-manager.js +1 -1
- package/esm/src/utils/common.utils.test.js +2 -2
- package/esm/src/utils/condition.test.js +2 -2
- package/esm/src/utils/endpoint.utils.test.js +2 -2
- package/esm/src/utils/factory.test.js +2 -2
- package/esm/src/utils/generator.utils.test.js +2 -2
- package/esm/src/utils/object.utils.test.js +2 -2
- package/esm/src/utils/schema.utils.test.js +59 -67
- package/esm/src/utils/source-builder.test.js +3 -4
- package/esm/src/utils/string-builder/string-builder.test.js +11 -12
- package/esm/src/utils/string.utils.test.js +2 -2
- package/esm/tests/openapi.test.js +1 -1
- package/package.json +2 -2
- package/script/_dnt.test_polyfills.d.ts +11 -0
- package/script/_dnt.test_polyfills.d.ts.map +1 -1
- package/script/_dnt.test_polyfills.js +14 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/assertion_error.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.11}/assertion_error.js +1 -1
- package/script/deps/jsr.io/@std/assert/1.0.11/false.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.11}/false.js +1 -1
- package/script/deps/jsr.io/@std/assert/1.0.11/instance_of.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.11}/instance_of.js +1 -1
- package/script/deps/jsr.io/@std/assert/1.0.11/match.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.11}/match.js +1 -1
- package/script/deps/jsr.io/@std/assert/1.0.11/not_instance_of.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.11}/not_instance_of.js +1 -1
- package/script/deps/jsr.io/@std/assert/1.0.11/not_match.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.11}/not_match.js +1 -1
- package/script/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.11}/not_strict_equals.js +2 -2
- package/script/deps/jsr.io/@std/assert/1.0.11/strict_equals.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.11}/strict_equals.js +6 -6
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_equals.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_assert_equals.js +2 -2
- package/{esm/deps/jsr.io/@std/assert/1.0.6/is_error.d.ts → script/deps/jsr.io/@std/expect/1.0.12/_assert_is_error.d.ts} +1 -12
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_is_error.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/{assert/1.0.6/is_error.js → expect/1.0.12/_assert_is_error.js} +8 -19
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_not_equals.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_assert_not_equals.js +3 -3
- package/script/deps/jsr.io/@std/expect/{1.0.5/_assertion.d.ts → 1.0.12/_assertions.d.ts} +2 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_assertions.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/{1.0.5/_assertion.js → 1.0.12/_assertions.js} +7 -2
- package/script/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_asymmetric_matchers.d.ts +14 -4
- package/script/deps/jsr.io/@std/expect/1.0.12/_asymmetric_matchers.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_asymmetric_matchers.js +61 -18
- package/script/deps/jsr.io/@std/expect/1.0.12/_build_message.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_build_message.js +9 -9
- package/script/deps/jsr.io/@std/expect/1.0.12/_custom_equality_tester.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_custom_equality_tester.js +1 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_equal.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_equal.js +8 -8
- package/script/deps/jsr.io/@std/expect/1.0.12/_extend.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_extend.js +1 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_inspect_args.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_inspect_args.js +1 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_matchers.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_matchers.js +748 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_mock_util.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_mock_util.js +1 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_serializer.d.ts +4 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_serializer.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_serializer.js +14 -0
- package/script/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_types.d.ts +7 -2
- package/script/deps/jsr.io/@std/expect/1.0.12/_types.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_types.js +1 -1
- package/script/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_utils.d.ts +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_utils.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_utils.js +61 -1
- package/{esm/deps/jsr.io/@std/expect/1.0.5 → script/deps/jsr.io/@std/expect/1.0.12}/expect.d.ts +10 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/expect.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/expect.js +103 -5
- package/script/deps/jsr.io/@std/expect/1.0.12/fn.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/fn.js +1 -1
- package/{esm/deps/jsr.io/@std/expect/1.0.5 → script/deps/jsr.io/@std/expect/1.0.12}/mod.d.ts +8 -7
- package/script/deps/jsr.io/@std/expect/1.0.12/mod.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/mod.js +9 -8
- package/script/deps/jsr.io/@std/internal/1.0.5/assertion_state.d.ts +160 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/assertion_state.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/assertion_state.js +204 -0
- package/script/deps/jsr.io/@std/internal/{1.0.4 → 1.0.5}/build_message.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/internal/{1.0.4 → 1.0.5}/diff.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/internal/{1.0.4 → 1.0.5}/diff_str.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/internal/{1.0.4 → 1.0.5}/format.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/internal/{1.0.4 → 1.0.5}/styles.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/internal/{1.0.4 → 1.0.5}/types.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/testing/{1.0.3 → 1.0.9}/_test_suite.d.ts +6 -1
- package/script/deps/jsr.io/@std/testing/1.0.9/_test_suite.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/testing/{1.0.3 → 1.0.9}/_test_suite.js +46 -6
- package/script/deps/jsr.io/@std/testing/{1.0.3 → 1.0.9}/bdd.d.ts +12 -5
- package/{esm/deps/jsr.io/@std/testing/1.0.3 → script/deps/jsr.io/@std/testing/1.0.9}/bdd.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/testing/{1.0.3 → 1.0.9}/bdd.js +84 -6
- package/script/src/collect/helpers.test.js +2 -2
- package/script/src/transform/helpers.test.js +2 -2
- package/script/src/utils/action-provider.test.js +2 -2
- package/script/src/utils/asset-manager.d.ts +1 -0
- package/script/src/utils/asset-manager.d.ts.map +1 -1
- package/script/src/utils/asset-manager.js +1 -1
- package/script/src/utils/common.utils.test.js +2 -2
- package/script/src/utils/condition.test.js +2 -2
- package/script/src/utils/endpoint.utils.test.js +2 -2
- package/script/src/utils/factory.test.js +2 -2
- package/script/src/utils/generator.utils.test.js +2 -2
- package/script/src/utils/object.utils.test.js +2 -2
- package/script/src/utils/schema.utils.test.js +58 -66
- package/script/src/utils/source-builder.test.js +3 -4
- package/script/src/utils/string-builder/string-builder.test.js +11 -12
- package/script/src/utils/string.utils.test.js +2 -2
- package/script/tests/openapi.test.js +1 -1
- package/src/_dnt.test_polyfills.ts +27 -0
- package/src/deps/jsr.io/@std/assert/{1.0.6 → 1.0.11}/assertion_error.ts +1 -1
- package/src/deps/jsr.io/@std/assert/{1.0.6 → 1.0.11}/false.ts +1 -1
- package/src/deps/jsr.io/@std/assert/{1.0.6 → 1.0.11}/instance_of.ts +1 -1
- package/src/deps/jsr.io/@std/assert/{1.0.6 → 1.0.11}/match.ts +1 -1
- package/src/deps/jsr.io/@std/assert/{1.0.6 → 1.0.11}/not_instance_of.ts +1 -1
- package/src/deps/jsr.io/@std/assert/{1.0.6 → 1.0.11}/not_match.ts +1 -1
- package/src/deps/jsr.io/@std/assert/{1.0.6 → 1.0.11}/not_strict_equals.ts +2 -2
- package/src/deps/jsr.io/@std/assert/{1.0.6 → 1.0.11}/strict_equals.ts +6 -6
- package/src/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_assert_equals.ts +2 -2
- package/src/deps/jsr.io/@std/{assert/1.0.6/is_error.ts → expect/1.0.12/_assert_is_error.ts} +8 -19
- package/src/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_assert_not_equals.ts +3 -3
- package/src/deps/jsr.io/@std/expect/1.0.12/_assertions.ts +18 -0
- package/src/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_asymmetric_matchers.ts +69 -18
- package/src/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_build_message.ts +9 -9
- package/src/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_custom_equality_tester.ts +1 -1
- package/src/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_equal.ts +10 -9
- package/src/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_extend.ts +1 -1
- package/src/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_inspect_args.ts +1 -1
- package/src/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_matchers.ts +308 -108
- package/src/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_mock_util.ts +1 -1
- package/src/deps/jsr.io/@std/expect/1.0.12/_serializer.ts +15 -0
- package/src/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_types.ts +9 -3
- package/src/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_utils.ts +83 -1
- package/src/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/expect.ts +113 -4
- package/src/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/fn.ts +1 -1
- package/src/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/mod.ts +9 -8
- package/src/deps/jsr.io/@std/internal/1.0.5/assertion_state.ts +214 -0
- package/src/deps/jsr.io/@std/testing/{1.0.3 → 1.0.9}/_test_suite.ts +68 -9
- package/src/deps/jsr.io/@std/testing/{1.0.3 → 1.0.9}/bdd.ts +98 -12
- package/src/src/collect/helpers.test.ts +2 -2
- package/src/src/transform/helpers.test.ts +2 -2
- package/src/src/utils/action-provider.test.ts +2 -2
- package/src/src/utils/asset-manager.ts +1 -1
- package/src/src/utils/common.utils.test.ts +2 -2
- package/src/src/utils/condition.test.ts +2 -2
- package/src/src/utils/endpoint.utils.test.ts +2 -2
- package/src/src/utils/factory.test.ts +2 -2
- package/src/src/utils/generator.utils.test.ts +2 -2
- package/src/src/utils/object.utils.test.ts +2 -2
- package/src/src/utils/schema.utils.test.ts +68 -67
- package/src/src/utils/source-builder.test.ts +3 -4
- package/src/src/utils/string-builder/string-builder.test.ts +11 -12
- package/src/src/utils/string.utils.test.ts +2 -2
- package/src/tests/openapi.test.ts +1 -1
- package/esm/deps/jsr.io/@std/assert/1.0.6/assertion_error.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.6/equal.d.ts +0 -17
- package/esm/deps/jsr.io/@std/assert/1.0.6/equal.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.6/equal.js +0 -136
- package/esm/deps/jsr.io/@std/assert/1.0.6/equals.d.ts +0 -22
- package/esm/deps/jsr.io/@std/assert/1.0.6/equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.6/equals.js +0 -45
- package/esm/deps/jsr.io/@std/assert/1.0.6/false.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.6/instance_of.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.6/is_error.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.6/match.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.6/not_instance_of.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.6/not_match.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.6/not_strict_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.6/object_match.d.ts +0 -28
- package/esm/deps/jsr.io/@std/assert/1.0.6/object_match.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.6/object_match.js +0 -159
- package/esm/deps/jsr.io/@std/assert/1.0.6/strict_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.5/_assert_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.5/_assert_not_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.5/_assertion.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.5/_assertion.js +0 -9
- package/esm/deps/jsr.io/@std/expect/1.0.5/_asymmetric_matchers.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.5/_build_message.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.5/_custom_equality_tester.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.5/_equal.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.5/_extend.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.5/_inspect_args.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.5/_matchers.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.5/_matchers.js +0 -564
- package/esm/deps/jsr.io/@std/expect/1.0.5/_mock_util.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.5/_types.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.5/_types.js +0 -3
- package/esm/deps/jsr.io/@std/expect/1.0.5/_utils.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.5/expect.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.5/fn.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.5/mod.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.4/assertion_state.d.ts +0 -75
- package/esm/deps/jsr.io/@std/internal/1.0.4/assertion_state.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.4/assertion_state.js +0 -101
- package/esm/deps/jsr.io/@std/testing/1.0.3/_test_suite.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.6/assertion_error.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.6/equal.d.ts +0 -17
- package/script/deps/jsr.io/@std/assert/1.0.6/equal.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.6/equal.js +0 -139
- package/script/deps/jsr.io/@std/assert/1.0.6/equals.d.ts +0 -22
- package/script/deps/jsr.io/@std/assert/1.0.6/equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.6/equals.js +0 -48
- package/script/deps/jsr.io/@std/assert/1.0.6/false.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.6/instance_of.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.6/is_error.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.6/match.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.6/not_instance_of.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.6/not_match.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.6/not_strict_equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.6/object_match.d.ts +0 -28
- package/script/deps/jsr.io/@std/assert/1.0.6/object_match.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.6/object_match.js +0 -162
- package/script/deps/jsr.io/@std/assert/1.0.6/strict_equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.5/_assert_equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.5/_assert_not_equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.5/_assertion.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.5/_asymmetric_matchers.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.5/_build_message.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.5/_custom_equality_tester.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.5/_equal.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.5/_extend.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.5/_inspect_args.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.5/_matchers.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.5/_matchers.js +0 -598
- package/script/deps/jsr.io/@std/expect/1.0.5/_mock_util.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.5/_types.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.5/_utils.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.5/expect.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.5/fn.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.5/mod.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.4/assertion_state.d.ts +0 -75
- package/script/deps/jsr.io/@std/internal/1.0.4/assertion_state.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.4/assertion_state.js +0 -106
- package/script/deps/jsr.io/@std/testing/1.0.3/_test_suite.d.ts.map +0 -1
- package/src/deps/jsr.io/@std/assert/1.0.6/equal.ts +0 -152
- package/src/deps/jsr.io/@std/assert/1.0.6/equals.ts +0 -52
- package/src/deps/jsr.io/@std/assert/1.0.6/object_match.ts +0 -202
- package/src/deps/jsr.io/@std/expect/1.0.5/_assertion.ts +0 -13
- package/src/deps/jsr.io/@std/internal/1.0.4/assertion_state.ts +0 -111
- /package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.11}/assertion_error.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.11}/false.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.11}/instance_of.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.11}/match.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.11}/not_instance_of.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.11}/not_match.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.11}/not_strict_equals.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.11}/strict_equals.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_assert_equals.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_assert_not_equals.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_build_message.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_custom_equality_tester.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_equal.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_extend.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_inspect_args.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_matchers.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_mock_util.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/fn.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.4 → 1.0.5}/build_message.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.4 → 1.0.5}/build_message.js +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.4 → 1.0.5}/diff.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.4 → 1.0.5}/diff.js +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.4 → 1.0.5}/diff_str.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.4 → 1.0.5}/diff_str.js +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.4 → 1.0.5}/format.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.4 → 1.0.5}/format.js +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.4 → 1.0.5}/styles.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.4 → 1.0.5}/styles.js +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.4 → 1.0.5}/types.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.4 → 1.0.5}/types.js +0 -0
- /package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.11}/assertion_error.d.ts +0 -0
- /package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.11}/false.d.ts +0 -0
- /package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.11}/instance_of.d.ts +0 -0
- /package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.11}/match.d.ts +0 -0
- /package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.11}/not_instance_of.d.ts +0 -0
- /package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.11}/not_match.d.ts +0 -0
- /package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.11}/not_strict_equals.d.ts +0 -0
- /package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.11}/strict_equals.d.ts +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_assert_equals.d.ts +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_assert_not_equals.d.ts +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_build_message.d.ts +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_custom_equality_tester.d.ts +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_equal.d.ts +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_extend.d.ts +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_inspect_args.d.ts +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_matchers.d.ts +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/_mock_util.d.ts +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.5 → 1.0.12}/fn.d.ts +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.4 → 1.0.5}/build_message.d.ts +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.4 → 1.0.5}/build_message.js +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.4 → 1.0.5}/diff.d.ts +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.4 → 1.0.5}/diff.js +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.4 → 1.0.5}/diff_str.d.ts +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.4 → 1.0.5}/diff_str.js +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.4 → 1.0.5}/format.d.ts +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.4 → 1.0.5}/format.js +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.4 → 1.0.5}/styles.d.ts +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.4 → 1.0.5}/styles.js +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.4 → 1.0.5}/types.d.ts +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.4 → 1.0.5}/types.js +0 -0
- /package/src/deps/jsr.io/@std/internal/{1.0.4 → 1.0.5}/build_message.ts +0 -0
- /package/src/deps/jsr.io/@std/internal/{1.0.4 → 1.0.5}/diff.ts +0 -0
- /package/src/deps/jsr.io/@std/internal/{1.0.4 → 1.0.5}/diff_str.ts +0 -0
- /package/src/deps/jsr.io/@std/internal/{1.0.4 → 1.0.5}/format.ts +0 -0
- /package/src/deps/jsr.io/@std/internal/{1.0.4 → 1.0.5}/styles.ts +0 -0
- /package/src/deps/jsr.io/@std/internal/{1.0.4 → 1.0.5}/types.ts +0 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
2
|
+
|
|
3
|
+
import type { SnapshotPlugin } from "./_types.js";
|
|
4
|
+
|
|
5
|
+
const INTERNAL_PLUGINS: SnapshotPlugin[] = [
|
|
6
|
+
// TODO(eryue0220): support internal snapshot serializer plugins
|
|
7
|
+
];
|
|
8
|
+
|
|
9
|
+
export function addSerializer(plugin: SnapshotPlugin) {
|
|
10
|
+
INTERNAL_PLUGINS.unshift(plugin);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function getSerializer() {
|
|
14
|
+
return INTERNAL_PLUGINS;
|
|
15
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright 2018-
|
|
1
|
+
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
2
2
|
// deno-lint-ignore-file no-explicit-any
|
|
3
3
|
|
|
4
4
|
export interface MatcherContext {
|
|
@@ -177,7 +177,10 @@ export interface Expected<IsAsync = false> {
|
|
|
177
177
|
toBeCalledWith(...expected: unknown[]): void;
|
|
178
178
|
|
|
179
179
|
/**
|
|
180
|
-
* Asserts that
|
|
180
|
+
* Asserts that a given numerical value is approximately equal to an
|
|
181
|
+
* expected number within a certain margin of error
|
|
182
|
+
* (tolerance). Useful when comparing floating-point numbers, which
|
|
183
|
+
* may be represented internally with precision errors.
|
|
181
184
|
*
|
|
182
185
|
* @example Usage
|
|
183
186
|
* ```ts
|
|
@@ -189,7 +192,8 @@ export interface Expected<IsAsync = false> {
|
|
|
189
192
|
* ```
|
|
190
193
|
*
|
|
191
194
|
* @param candidate The candidate number.
|
|
192
|
-
* @param tolerance The
|
|
195
|
+
* @param tolerance The number of significant decimal digits to
|
|
196
|
+
* consider when comparing the values (optional, default 2).
|
|
193
197
|
*/
|
|
194
198
|
toBeCloseTo(candidate: number, tolerance?: number): void;
|
|
195
199
|
|
|
@@ -915,3 +919,5 @@ export interface OldSnapshotPlugin {
|
|
|
915
919
|
) => string;
|
|
916
920
|
test: Test;
|
|
917
921
|
}
|
|
922
|
+
|
|
923
|
+
export type SnapshotPlugin = NewSnapshotPlugin | OldSnapshotPlugin;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright 2018-
|
|
1
|
+
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
2
2
|
// Copyright (c) Meta Platforms, Inc. and affiliates. All rights reserved. MIT license.
|
|
3
3
|
|
|
4
4
|
import type { EqualOptions, EqualOptionUtil } from "./_types.js";
|
|
@@ -40,6 +40,40 @@ function isObject(a: unknown) {
|
|
|
40
40
|
return a !== null && typeof a === "object";
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
function isObjectWithKeys(a: unknown) {
|
|
44
|
+
return (
|
|
45
|
+
isObject(a) &&
|
|
46
|
+
!(a instanceof Error) &&
|
|
47
|
+
!Array.isArray(a) &&
|
|
48
|
+
!(a instanceof Date) &&
|
|
49
|
+
!(a instanceof Set) &&
|
|
50
|
+
!(a instanceof Map)
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function getObjectKeys(object: object): Array<string | symbol> {
|
|
55
|
+
return [
|
|
56
|
+
...Object.keys(object),
|
|
57
|
+
...Object.getOwnPropertySymbols(object).filter(
|
|
58
|
+
(s) => Object.getOwnPropertyDescriptor(object, s)?.enumerable,
|
|
59
|
+
),
|
|
60
|
+
];
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function hasPropertyInObject(object: object, key: string | symbol): boolean {
|
|
64
|
+
const shouldTerminate = !object || typeof object !== "object" ||
|
|
65
|
+
object === Object.prototype;
|
|
66
|
+
|
|
67
|
+
if (shouldTerminate) {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return (
|
|
72
|
+
Object.prototype.hasOwnProperty.call(object, key) ||
|
|
73
|
+
hasPropertyInObject(Object.getPrototypeOf(object), key)
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
43
77
|
// deno-lint-ignore no-explicit-any
|
|
44
78
|
function entries(obj: any) {
|
|
45
79
|
if (!isObject(obj)) return [];
|
|
@@ -199,3 +233,51 @@ export function iterableEquality(
|
|
|
199
233
|
bStack.pop();
|
|
200
234
|
return true;
|
|
201
235
|
}
|
|
236
|
+
|
|
237
|
+
// Ported from https://github.com/jestjs/jest/blob/442c7f692e3a92f14a2fb56c1737b26fc663a0ef/packages/expect-utils/src/utils.ts#L341
|
|
238
|
+
export function subsetEquality(
|
|
239
|
+
object: unknown,
|
|
240
|
+
subset: unknown,
|
|
241
|
+
customTesters: Tester[] = [],
|
|
242
|
+
): boolean | undefined {
|
|
243
|
+
const filteredCustomTesters = customTesters.filter((t) =>
|
|
244
|
+
t !== subsetEquality
|
|
245
|
+
);
|
|
246
|
+
|
|
247
|
+
const subsetEqualityWithContext =
|
|
248
|
+
(seenReferences: WeakMap<object, boolean> = new WeakMap()) =>
|
|
249
|
+
// deno-lint-ignore no-explicit-any
|
|
250
|
+
(object: any, subset: any): boolean | undefined => {
|
|
251
|
+
if (!isObjectWithKeys(subset)) {
|
|
252
|
+
return undefined;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
if (seenReferences.has(subset)) return undefined;
|
|
256
|
+
seenReferences.set(subset, true);
|
|
257
|
+
|
|
258
|
+
const matchResult = getObjectKeys(subset).every((key) => {
|
|
259
|
+
if (isObjectWithKeys(subset[key])) {
|
|
260
|
+
if (seenReferences.has(subset[key])) {
|
|
261
|
+
return equal(object[key], subset[key], {
|
|
262
|
+
customTesters: filteredCustomTesters,
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
const result = object != null &&
|
|
267
|
+
hasPropertyInObject(object, key) &&
|
|
268
|
+
equal(object[key], subset[key], {
|
|
269
|
+
customTesters: [
|
|
270
|
+
...filteredCustomTesters,
|
|
271
|
+
subsetEqualityWithContext(seenReferences),
|
|
272
|
+
],
|
|
273
|
+
});
|
|
274
|
+
seenReferences.delete(subset[key]);
|
|
275
|
+
return result;
|
|
276
|
+
});
|
|
277
|
+
seenReferences.delete(subset);
|
|
278
|
+
|
|
279
|
+
return matchResult;
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
return subsetEqualityWithContext()(object, subset);
|
|
283
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright 2018-
|
|
1
|
+
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
2
2
|
// This module is browser compatible.
|
|
3
3
|
// Copyright 2019 Allain Lalonde. All rights reserved. ISC License.
|
|
4
4
|
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
@@ -13,8 +13,12 @@ import type {
|
|
|
13
13
|
MatcherKey,
|
|
14
14
|
Matchers,
|
|
15
15
|
} from "./_types.js";
|
|
16
|
-
import { AssertionError } from "../../assert/1.0.
|
|
17
|
-
import {
|
|
16
|
+
import { AssertionError } from "../../assert/1.0.11/assertion_error.js";
|
|
17
|
+
import {
|
|
18
|
+
assertions,
|
|
19
|
+
emitAssertionTrigger,
|
|
20
|
+
hasAssertions,
|
|
21
|
+
} from "./_assertions.js";
|
|
18
22
|
import {
|
|
19
23
|
addCustomEqualityTesters,
|
|
20
24
|
getCustomEqualityTesters,
|
|
@@ -55,9 +59,10 @@ import {
|
|
|
55
59
|
toStrictEqual,
|
|
56
60
|
toThrow,
|
|
57
61
|
} from "./_matchers.js";
|
|
62
|
+
import { addSerializer } from "./_serializer.js";
|
|
58
63
|
import { isPromiseLike } from "./_utils.js";
|
|
59
64
|
import * as asymmetricMatchers from "./_asymmetric_matchers.js";
|
|
60
|
-
import type { Tester } from "./_types.js";
|
|
65
|
+
import type { SnapshotPlugin, Tester } from "./_types.js";
|
|
61
66
|
|
|
62
67
|
export type { AnyConstructor, Async, Expected } from "./_types.js";
|
|
63
68
|
|
|
@@ -491,6 +496,7 @@ expect.stringContaining = asymmetricMatchers.stringContaining as (
|
|
|
491
496
|
expect.stringMatching = asymmetricMatchers.stringMatching as (
|
|
492
497
|
pattern: string | RegExp,
|
|
493
498
|
) => ReturnType<typeof asymmetricMatchers.stringMatching>;
|
|
499
|
+
|
|
494
500
|
/**
|
|
495
501
|
* `expect.hasAssertions` verifies that at least one assertion is called during a test.
|
|
496
502
|
*
|
|
@@ -509,3 +515,106 @@ expect.stringMatching = asymmetricMatchers.stringMatching as (
|
|
|
509
515
|
* ```
|
|
510
516
|
*/
|
|
511
517
|
expect.hasAssertions = hasAssertions as () => void;
|
|
518
|
+
|
|
519
|
+
/**
|
|
520
|
+
* `expect.assertions` verifies that a certain number of assertions are called during a test.
|
|
521
|
+
*
|
|
522
|
+
* Note: expect.assertions only can use in bdd function test suite, such as `test` or `it`.
|
|
523
|
+
*
|
|
524
|
+
* @example
|
|
525
|
+
* ```ts
|
|
526
|
+
*
|
|
527
|
+
* import { test } from "@std/testing/bdd";
|
|
528
|
+
* import { expect } from "@std/expect";
|
|
529
|
+
*
|
|
530
|
+
* test("it works", () => {
|
|
531
|
+
* expect.assertions(1);
|
|
532
|
+
* expect("a").not.toBe("b");
|
|
533
|
+
* });
|
|
534
|
+
* ```
|
|
535
|
+
*/
|
|
536
|
+
expect.assertions = assertions as (num: number) => void;
|
|
537
|
+
|
|
538
|
+
/**
|
|
539
|
+
* `expect.objectContaining(object)` matches any received object that recursively matches the expected properties.
|
|
540
|
+
* That is, the expected object is not a subset of the received object. Therefore, it matches a received object
|
|
541
|
+
* which contains properties that are not in the expected object.
|
|
542
|
+
*
|
|
543
|
+
* @example
|
|
544
|
+
* ```ts
|
|
545
|
+
* import { expect } from "@std/expect";
|
|
546
|
+
*
|
|
547
|
+
* Deno.test("example", () => {
|
|
548
|
+
* expect({ bar: 'baz' }).toEqual(expect.objectContaining({ bar: 'baz'}));
|
|
549
|
+
* expect({ bar: 'baz' }).not.toEqual(expect.objectContaining({ foo: 'bar'}));
|
|
550
|
+
* });
|
|
551
|
+
* ```
|
|
552
|
+
*/
|
|
553
|
+
expect.objectContaining = asymmetricMatchers.objectContaining as (
|
|
554
|
+
obj: Record<string, unknown>,
|
|
555
|
+
) => ReturnType<typeof asymmetricMatchers.objectContaining>;
|
|
556
|
+
/**
|
|
557
|
+
* `expect.not.arrayContaining` matches a received array which does not contain
|
|
558
|
+
* all of the elements in the expected array. That is, the expected array is not
|
|
559
|
+
* a subset of the received array.
|
|
560
|
+
*
|
|
561
|
+
* `expect.not.objectContaining` matches any received object that does not recursively
|
|
562
|
+
* match the expected properties. That is, the expected object is not a subset of the
|
|
563
|
+
* received object. Therefore, it matches a received object which contains properties
|
|
564
|
+
* that are not in the expected object.
|
|
565
|
+
*
|
|
566
|
+
* `expect.not.stringContaining` matches the received value if it is not a string
|
|
567
|
+
* or if it is a string that does not contain the exact expected string.
|
|
568
|
+
*
|
|
569
|
+
* `expect.not.stringMatching` matches the received value if it is not a string
|
|
570
|
+
* or if it is a string that does not match the expected string or regular expression.
|
|
571
|
+
*
|
|
572
|
+
* @example
|
|
573
|
+
* ```ts
|
|
574
|
+
* import { expect } from "@std/expect";
|
|
575
|
+
*
|
|
576
|
+
* Deno.test("expect.not.arrayContaining", () => {
|
|
577
|
+
* const expected = ["Samantha"];
|
|
578
|
+
* expect(["Alice", "Bob", "Eve"]).toEqual(expect.not.arrayContaining(expected));
|
|
579
|
+
* });
|
|
580
|
+
*
|
|
581
|
+
* Deno.test("expect.not.objectContaining", () => {
|
|
582
|
+
* const expected = { foo: "bar" };
|
|
583
|
+
* expect({ bar: "baz" }).toEqual(expect.not.objectContaining(expected));
|
|
584
|
+
* });
|
|
585
|
+
*
|
|
586
|
+
* Deno.test("expect.not.stringContaining", () => {
|
|
587
|
+
* const expected = "Hello world!";
|
|
588
|
+
* expect("How are you?").toEqual(expect.not.stringContaining(expected));
|
|
589
|
+
* });
|
|
590
|
+
*
|
|
591
|
+
* Deno.test("expect.not.stringMatching", () => {
|
|
592
|
+
* const expected = /Hello world!/;
|
|
593
|
+
* expect("How are you?").toEqual(expect.not.stringMatching(expected));
|
|
594
|
+
* });
|
|
595
|
+
* ```
|
|
596
|
+
*/
|
|
597
|
+
expect.not = {
|
|
598
|
+
arrayContaining: asymmetricMatchers.arrayNotContaining,
|
|
599
|
+
objectContaining: asymmetricMatchers.objectNotContaining,
|
|
600
|
+
stringContaining: asymmetricMatchers.stringNotContaining,
|
|
601
|
+
stringMatching: asymmetricMatchers.stringNotMatching,
|
|
602
|
+
};
|
|
603
|
+
/**
|
|
604
|
+
* `expect.addSnapshotSerializer` adds a module that formats application-specific data structures.
|
|
605
|
+
*
|
|
606
|
+
* For an individual test file, an added module precedes any modules from snapshotSerializers configuration,
|
|
607
|
+
* which precede the default snapshot serializers for built-in JavaScript types.
|
|
608
|
+
* The last module added is the first module tested.
|
|
609
|
+
*
|
|
610
|
+
* @example
|
|
611
|
+
* ```ts
|
|
612
|
+
* import { expect } from "@std/expect";
|
|
613
|
+
* import serializerAnsi from "npm:jest-snapshot-serializer-ansi";
|
|
614
|
+
*
|
|
615
|
+
* expect.addSnapshotSerializer(serializerAnsi);
|
|
616
|
+
* ```
|
|
617
|
+
*/
|
|
618
|
+
expect.addSnapshotSerializer = addSerializer as (
|
|
619
|
+
plugin: SnapshotPlugin,
|
|
620
|
+
) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright 2018-
|
|
1
|
+
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
2
2
|
// This module is browser compatible.
|
|
3
3
|
// Copyright 2019 Allain Lalonde. All rights reserved. ISC License.
|
|
4
4
|
// deno-lint-ignore-file no-explicit-any ban-types
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright 2018-
|
|
1
|
+
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
2
2
|
// Copyright 2019 Allain Lalonde. All rights reserved. ISC License.
|
|
3
3
|
// This module is browser compatible.
|
|
4
4
|
|
|
@@ -54,26 +54,27 @@
|
|
|
54
54
|
* - {@linkcode expect.anything}
|
|
55
55
|
* - {@linkcode expect.any}
|
|
56
56
|
* - {@linkcode expect.arrayContaining}
|
|
57
|
+
* - {@linkcode expect.not.arrayContaining}
|
|
58
|
+
* - {@linkcode expect.objectContaining}
|
|
59
|
+
* - {@linkcode expect.not.objectContaining}
|
|
57
60
|
* - {@linkcode expect.closeTo}
|
|
58
61
|
* - {@linkcode expect.stringContaining}
|
|
62
|
+
* - {@linkcode expect.not.stringContaining}
|
|
59
63
|
* - {@linkcode expect.stringMatching}
|
|
64
|
+
* - {@linkcode expect.not.stringMatching}
|
|
60
65
|
* - Utilities:
|
|
66
|
+
* - {@linkcode expect.addSnapshotSerializer}
|
|
67
|
+
* - {@linkcode expect.assertions}
|
|
61
68
|
* - {@linkcode expect.addEqualityTester}
|
|
62
69
|
* - {@linkcode expect.extend}
|
|
63
70
|
* - {@linkcode expect.hasAssertions}
|
|
64
71
|
*
|
|
65
72
|
* Only these functions are still not available:
|
|
66
73
|
* - Matchers:
|
|
67
|
-
* - `
|
|
74
|
+
* - `toMatchSnapshot`
|
|
68
75
|
* - `toMatchInlineSnapshot`
|
|
69
76
|
* - `toThrowErrorMatchingSnapshot`
|
|
70
77
|
* - `toThrowErrorMatchingInlineSnapshot`
|
|
71
|
-
* - Asymmetric matchers:
|
|
72
|
-
* - `expect.objectContaining`
|
|
73
|
-
* - `expect.not.objectContaining`
|
|
74
|
-
* - Utilities:
|
|
75
|
-
* - `expect.assertions`
|
|
76
|
-
* - `expect.addSnapshotSerializer`
|
|
77
78
|
*
|
|
78
79
|
* The tracking issue to add support for unsupported parts of the API is
|
|
79
80
|
* {@link https://github.com/denoland/std/issues/3964}.
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Check the test suite internal state
|
|
5
|
+
*
|
|
6
|
+
* @example Usage
|
|
7
|
+
* ```ts ignore
|
|
8
|
+
* import { AssertionState } from "@std/internal";
|
|
9
|
+
*
|
|
10
|
+
* const assertionState = new AssertionState();
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export class AssertionState {
|
|
14
|
+
#state: {
|
|
15
|
+
assertionCount: number | undefined;
|
|
16
|
+
assertionCheck: boolean;
|
|
17
|
+
assertionTriggered: boolean;
|
|
18
|
+
assertionTriggeredCount: number;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
constructor() {
|
|
22
|
+
this.#state = {
|
|
23
|
+
assertionCount: undefined,
|
|
24
|
+
assertionCheck: false,
|
|
25
|
+
assertionTriggered: false,
|
|
26
|
+
assertionTriggeredCount: 0,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Get the number that through `expect.assertions` api set.
|
|
32
|
+
*
|
|
33
|
+
* @returns the number that through `expect.assertions` api set.
|
|
34
|
+
*
|
|
35
|
+
* @example Usage
|
|
36
|
+
* ```ts ignore
|
|
37
|
+
* import { AssertionState } from "@std/internal";
|
|
38
|
+
*
|
|
39
|
+
* const assertionState = new AssertionState();
|
|
40
|
+
* assertionState.assertionCount;
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
get assertionCount(): number | undefined {
|
|
44
|
+
return this.#state.assertionCount;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Get a certain number that assertions were called before.
|
|
49
|
+
*
|
|
50
|
+
* @returns return a certain number that assertions were called before.
|
|
51
|
+
*
|
|
52
|
+
* @example Usage
|
|
53
|
+
* ```ts ignore
|
|
54
|
+
* import { AssertionState } from "@std/internal";
|
|
55
|
+
*
|
|
56
|
+
* const assertionState = new AssertionState();
|
|
57
|
+
* assertionState.assertionTriggeredCount;
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
get assertionTriggeredCount(): number {
|
|
61
|
+
return this.#state.assertionTriggeredCount;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* If `expect.hasAssertions` called, then through this method to update #state.assertionCheck value.
|
|
66
|
+
*
|
|
67
|
+
* @param val Set #state.assertionCheck's value
|
|
68
|
+
*
|
|
69
|
+
* @example Usage
|
|
70
|
+
* ```ts ignore
|
|
71
|
+
* import { AssertionState } from "@std/internal";
|
|
72
|
+
*
|
|
73
|
+
* const assertionState = new AssertionState();
|
|
74
|
+
* assertionState.setAssertionCheck(true);
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
setAssertionCheck(val: boolean) {
|
|
78
|
+
this.#state.assertionCheck = val;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* If any matchers was called, `#state.assertionTriggered` will be set through this method.
|
|
83
|
+
*
|
|
84
|
+
* @param val Set #state.assertionTriggered's value
|
|
85
|
+
*
|
|
86
|
+
* @example Usage
|
|
87
|
+
* ```ts ignore
|
|
88
|
+
* import { AssertionState } from "@std/internal";
|
|
89
|
+
*
|
|
90
|
+
* const assertionState = new AssertionState();
|
|
91
|
+
* assertionState.setAssertionTriggered(true);
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
setAssertionTriggered(val: boolean) {
|
|
95
|
+
this.#state.assertionTriggered = val;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* If `expect.assertions` called, then through this method to update #state.assertionCheck value.
|
|
100
|
+
*
|
|
101
|
+
* @param num Set #state.assertionCount's value, for example if the value is set 2, that means
|
|
102
|
+
* you must have two assertion matchers call in your test suite.
|
|
103
|
+
*
|
|
104
|
+
* @example Usage
|
|
105
|
+
* ```ts ignore
|
|
106
|
+
* import { AssertionState } from "@std/internal";
|
|
107
|
+
*
|
|
108
|
+
* const assertionState = new AssertionState();
|
|
109
|
+
* assertionState.setAssertionCount(2);
|
|
110
|
+
* ```
|
|
111
|
+
*/
|
|
112
|
+
setAssertionCount(num: number) {
|
|
113
|
+
this.#state.assertionCount = num;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* If any matchers was called, `#state.assertionTriggeredCount` value will plus one internally.
|
|
118
|
+
*
|
|
119
|
+
* @example Usage
|
|
120
|
+
* ```ts ignore
|
|
121
|
+
* import { AssertionState } from "@std/internal";
|
|
122
|
+
*
|
|
123
|
+
* const assertionState = new AssertionState();
|
|
124
|
+
* assertionState.updateAssertionTriggerCount();
|
|
125
|
+
* ```
|
|
126
|
+
*/
|
|
127
|
+
updateAssertionTriggerCount() {
|
|
128
|
+
if (this.#state.assertionCount !== undefined) {
|
|
129
|
+
this.#state.assertionTriggeredCount += 1;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Check Assertion internal state, if `#state.assertionCheck` is set true, but
|
|
135
|
+
* `#state.assertionTriggered` is still false, then should throw an Assertion Error.
|
|
136
|
+
*
|
|
137
|
+
* @returns a boolean value, that the test suite is satisfied with the check. If not,
|
|
138
|
+
* it should throw an AssertionError.
|
|
139
|
+
*
|
|
140
|
+
* @example Usage
|
|
141
|
+
* ```ts ignore
|
|
142
|
+
* import { AssertionState } from "@std/internal";
|
|
143
|
+
*
|
|
144
|
+
* const assertionState = new AssertionState();
|
|
145
|
+
* if (assertionState.checkAssertionErrorState()) {
|
|
146
|
+
* // throw AssertionError("");
|
|
147
|
+
* }
|
|
148
|
+
* ```
|
|
149
|
+
*/
|
|
150
|
+
checkAssertionErrorState(): boolean {
|
|
151
|
+
return this.#state.assertionCheck && !this.#state.assertionTriggered;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Reset all assertion state when every test suite function ran completely.
|
|
156
|
+
*
|
|
157
|
+
* @example Usage
|
|
158
|
+
* ```ts ignore
|
|
159
|
+
* import { AssertionState } from "@std/internal";
|
|
160
|
+
*
|
|
161
|
+
* const assertionState = new AssertionState();
|
|
162
|
+
* assertionState.resetAssertionState();
|
|
163
|
+
* ```
|
|
164
|
+
*/
|
|
165
|
+
resetAssertionState(): void {
|
|
166
|
+
this.#state = {
|
|
167
|
+
assertionCount: undefined,
|
|
168
|
+
assertionCheck: false,
|
|
169
|
+
assertionTriggered: false,
|
|
170
|
+
assertionTriggeredCount: 0,
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Check Assertion called state, if `#state.assertionCount` is set to a number value, but
|
|
176
|
+
* `#state.assertionTriggeredCount` is less then it, then should throw an assertion error.
|
|
177
|
+
*
|
|
178
|
+
* @returns a boolean value, that the test suite is satisfied with the check. If not,
|
|
179
|
+
* it should throw an AssertionError.
|
|
180
|
+
*
|
|
181
|
+
* @example Usage
|
|
182
|
+
* ```ts ignore
|
|
183
|
+
* import { AssertionState } from "@std/internal";
|
|
184
|
+
*
|
|
185
|
+
* const assertionState = new AssertionState();
|
|
186
|
+
* if (assertionState.checkAssertionCountSatisfied()) {
|
|
187
|
+
* // throw AssertionError("");
|
|
188
|
+
* }
|
|
189
|
+
* ```
|
|
190
|
+
*/
|
|
191
|
+
checkAssertionCountSatisfied(): boolean {
|
|
192
|
+
return this.#state.assertionCount !== undefined &&
|
|
193
|
+
this.#state.assertionCount !== this.#state.assertionTriggeredCount;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
const assertionState = new AssertionState();
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* return an instance of AssertionState
|
|
201
|
+
*
|
|
202
|
+
* @returns AssertionState
|
|
203
|
+
*
|
|
204
|
+
* @example Usage
|
|
205
|
+
* ```ts ignore
|
|
206
|
+
* import { getAssertionState } from "@std/internal";
|
|
207
|
+
*
|
|
208
|
+
* const assertionState = getAssertionState();
|
|
209
|
+
* assertionState.setAssertionTriggered(true);
|
|
210
|
+
* ```
|
|
211
|
+
*/
|
|
212
|
+
export function getAssertionState(): AssertionState {
|
|
213
|
+
return assertionState;
|
|
214
|
+
}
|
|
@@ -1,7 +1,18 @@
|
|
|
1
|
-
// Copyright 2018-
|
|
2
|
-
/** The options for creating a test suite with the describe function. */
|
|
1
|
+
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
3
2
|
import * as dntShim from "../../../../../_dnt.test_shims.js";
|
|
4
3
|
|
|
4
|
+
|
|
5
|
+
import { getAssertionState } from "../../internal/1.0.5/assertion_state.js";
|
|
6
|
+
import { AssertionError } from "../../assert/1.0.11/assertion_error.js";
|
|
7
|
+
|
|
8
|
+
export const globalSanitizersState = {
|
|
9
|
+
sanitizeExit: undefined as boolean | undefined,
|
|
10
|
+
sanitizeOps: undefined as boolean | undefined,
|
|
11
|
+
sanitizeResources: undefined as boolean | undefined,
|
|
12
|
+
};
|
|
13
|
+
const assertionState = getAssertionState();
|
|
14
|
+
|
|
15
|
+
/** The options for creating a test suite with the describe function. */
|
|
5
16
|
export interface DescribeDefinition<T> extends Omit<dntShim.Deno.TestDefinition, "fn"> {
|
|
6
17
|
/** The body of the test suite */
|
|
7
18
|
fn?: () => void | undefined;
|
|
@@ -78,7 +89,40 @@ export class TestSuiteInternal<T> implements TestSuite<T> {
|
|
|
78
89
|
this.symbol = Symbol();
|
|
79
90
|
TestSuiteInternal.suites.set(this.symbol, this);
|
|
80
91
|
|
|
81
|
-
const { fn } = describe;
|
|
92
|
+
const { fn, ignore } = describe;
|
|
93
|
+
if (ignore) {
|
|
94
|
+
const {
|
|
95
|
+
name,
|
|
96
|
+
only,
|
|
97
|
+
permissions,
|
|
98
|
+
sanitizeExit = globalSanitizersState.sanitizeExit,
|
|
99
|
+
sanitizeOps = globalSanitizersState.sanitizeOps,
|
|
100
|
+
sanitizeResources = globalSanitizersState.sanitizeResources,
|
|
101
|
+
} = describe;
|
|
102
|
+
const options: dntShim.Deno.TestDefinition = {
|
|
103
|
+
name,
|
|
104
|
+
fn: async () => {},
|
|
105
|
+
ignore: true,
|
|
106
|
+
};
|
|
107
|
+
if (only !== undefined) {
|
|
108
|
+
options.only = only;
|
|
109
|
+
}
|
|
110
|
+
if (permissions !== undefined) {
|
|
111
|
+
options.permissions = permissions;
|
|
112
|
+
}
|
|
113
|
+
if (sanitizeExit !== undefined) {
|
|
114
|
+
options.sanitizeExit = sanitizeExit;
|
|
115
|
+
}
|
|
116
|
+
if (sanitizeOps !== undefined) {
|
|
117
|
+
options.sanitizeOps = sanitizeOps;
|
|
118
|
+
}
|
|
119
|
+
if (sanitizeResources !== undefined) {
|
|
120
|
+
options.sanitizeResources = sanitizeResources;
|
|
121
|
+
}
|
|
122
|
+
TestSuiteInternal.registerTest(options);
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
|
|
82
126
|
if (fn) {
|
|
83
127
|
const temp = TestSuiteInternal.current;
|
|
84
128
|
TestSuiteInternal.current = this;
|
|
@@ -102,9 +146,9 @@ export class TestSuiteInternal<T> implements TestSuite<T> {
|
|
|
102
146
|
name,
|
|
103
147
|
ignore,
|
|
104
148
|
permissions,
|
|
105
|
-
sanitizeExit,
|
|
106
|
-
sanitizeOps,
|
|
107
|
-
sanitizeResources,
|
|
149
|
+
sanitizeExit = globalSanitizersState.sanitizeExit,
|
|
150
|
+
sanitizeOps = globalSanitizersState.sanitizeOps,
|
|
151
|
+
sanitizeResources = globalSanitizersState.sanitizeResources,
|
|
108
152
|
} = describe;
|
|
109
153
|
let { only } = describe;
|
|
110
154
|
if (!ignore && this.hasOnlyStep) {
|
|
@@ -294,9 +338,9 @@ export class TestSuiteInternal<T> implements TestSuite<T> {
|
|
|
294
338
|
fn,
|
|
295
339
|
ignore,
|
|
296
340
|
permissions,
|
|
297
|
-
sanitizeExit,
|
|
298
|
-
sanitizeOps,
|
|
299
|
-
sanitizeResources,
|
|
341
|
+
sanitizeExit = globalSanitizersState.sanitizeExit,
|
|
342
|
+
sanitizeOps = globalSanitizersState.sanitizeOps,
|
|
343
|
+
sanitizeResources = globalSanitizersState.sanitizeResources,
|
|
300
344
|
} = step instanceof TestSuiteInternal ? step.describe : step;
|
|
301
345
|
|
|
302
346
|
const options: dntShim.Deno.TestStepDefinition = {
|
|
@@ -385,5 +429,20 @@ export class TestSuiteInternal<T> implements TestSuite<T> {
|
|
|
385
429
|
} else {
|
|
386
430
|
await fn.call(context, t);
|
|
387
431
|
}
|
|
432
|
+
|
|
433
|
+
if (assertionState.checkAssertionErrorState()) {
|
|
434
|
+
throw new AssertionError(
|
|
435
|
+
"Expected at least one assertion to be called but received none",
|
|
436
|
+
);
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
if (assertionState.checkAssertionCountSatisfied()) {
|
|
440
|
+
throw new AssertionError(
|
|
441
|
+
`Expected at least ${assertionState.assertionCount} assertion to be called, ` +
|
|
442
|
+
`but received ${assertionState.assertionTriggeredCount}`,
|
|
443
|
+
);
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
assertionState.resetAssertionState();
|
|
388
447
|
}
|
|
389
448
|
}
|