@goast/kotlin 0.4.2 → 0.4.3
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/{script/deps/jsr.io/@std/assert/1.0.6 → esm/deps/jsr.io/@std/assert/1.0.7}/assertion_error.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/equal.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/equals.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/equals.js +4 -4
- package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/false.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/instance_of.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/is_error.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/is_error.js +2 -2
- package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/match.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/not_instance_of.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/not_match.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/not_strict_equals.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/not_strict_equals.js +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/rejects.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/strict_equals.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/strict_equals.js +5 -5
- package/esm/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_assert_equals.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_assert_equals.js +1 -1
- package/esm/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_assert_not_equals.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_assert_not_equals.js +1 -1
- package/esm/deps/jsr.io/@std/expect/{1.0.6/_assertion.d.ts → 1.0.7/_assertions.d.ts} +2 -1
- package/esm/deps/jsr.io/@std/expect/1.0.7/_assertions.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/{1.0.6/_assertion.js → 1.0.7/_assertions.js} +5 -1
- package/esm/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_asymmetric_matchers.d.ts +10 -5
- package/esm/deps/jsr.io/@std/expect/1.0.7/_asymmetric_matchers.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_asymmetric_matchers.js +37 -20
- package/esm/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_build_message.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_build_message.js +4 -4
- package/esm/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_custom_equality_tester.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_equal.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_equal.js +7 -7
- package/esm/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_extend.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_inspect_args.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/expect/1.0.7/_matchers.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_matchers.js +31 -32
- package/esm/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_mock_util.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_types.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_utils.d.ts +1 -0
- package/esm/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_utils.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_utils.js +59 -0
- package/{script/deps/jsr.io/@std/expect/1.0.6 → esm/deps/jsr.io/@std/expect/1.0.7}/expect.d.ts +7 -0
- package/esm/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/expect.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/expect.js +67 -2
- 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.4/_mock_utils.d.ts +15 -0
- package/esm/deps/jsr.io/@std/testing/1.0.4/_mock_utils.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/testing/1.0.4/_mock_utils.js +35 -0
- package/esm/deps/jsr.io/@std/testing/{1.0.3 → 1.0.4}/_test_suite.d.ts +1 -1
- package/{script/deps/jsr.io/@std/testing/1.0.3 → esm/deps/jsr.io/@std/testing/1.0.4}/_test_suite.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/testing/{1.0.3 → 1.0.4}/_test_suite.js +11 -1
- package/esm/deps/jsr.io/@std/testing/{1.0.3 → 1.0.4}/bdd.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/testing/{1.0.3 → 1.0.4}/bdd.js +8 -3
- package/esm/deps/jsr.io/@std/testing/{1.0.3 → 1.0.4}/mock.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/testing/{1.0.3 → 1.0.4}/mock.js +5 -39
- package/esm/src/ast/nodes/annotation.test.js +2 -2
- package/esm/src/ast/nodes/argument.test.js +2 -2
- package/esm/src/ast/nodes/call.test.js +2 -2
- package/esm/src/ast/nodes/class.test.js +2 -2
- package/esm/src/ast/nodes/constructor.test.js +2 -2
- package/esm/src/ast/nodes/doc-tag.test.js +2 -2
- package/esm/src/ast/nodes/doc.test.js +2 -2
- package/esm/src/ast/nodes/enum-value.test.js +2 -2
- package/esm/src/ast/nodes/enum.test.js +2 -2
- package/esm/src/ast/nodes/function.test.js +2 -2
- package/esm/src/ast/nodes/generic-parameter.test.js +2 -2
- package/esm/src/ast/nodes/init-block.test.js +2 -2
- package/esm/src/ast/nodes/interface.test.js +2 -2
- package/esm/src/ast/nodes/object.test.js +2 -2
- package/esm/src/ast/nodes/parameter.test.js +2 -2
- package/esm/src/ast/nodes/property.test.js +2 -2
- package/esm/src/ast/nodes/reference.test.js +2 -2
- package/esm/src/ast/nodes/string.test.js +2 -2
- package/esm/src/generators/services/spring-controllers/spring-controller-generator.d.ts.map +1 -1
- package/esm/src/generators/services/spring-controllers/spring-controller-generator.js +11 -7
- package/esm/src/import-collection.test.js +2 -2
- package/esm/tests/openapi-models.test.js +2 -2
- package/package.json +1 -1
- package/{esm/deps/jsr.io/@std/assert/1.0.6 → script/deps/jsr.io/@std/assert/1.0.7}/assertion_error.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/equal.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/equals.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/equals.js +4 -4
- package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/false.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/instance_of.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/is_error.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/is_error.js +2 -2
- package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/match.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/not_instance_of.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/not_match.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/not_strict_equals.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/not_strict_equals.js +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/rejects.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/strict_equals.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/strict_equals.js +5 -5
- package/script/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_assert_equals.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_assert_equals.js +1 -1
- package/script/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_assert_not_equals.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_assert_not_equals.js +1 -1
- package/script/deps/jsr.io/@std/expect/{1.0.6/_assertion.d.ts → 1.0.7/_assertions.d.ts} +2 -1
- package/script/deps/jsr.io/@std/expect/1.0.7/_assertions.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/{1.0.6/_assertion.js → 1.0.7/_assertions.js} +6 -1
- package/script/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_asymmetric_matchers.d.ts +10 -5
- package/script/deps/jsr.io/@std/expect/1.0.7/_asymmetric_matchers.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_asymmetric_matchers.js +41 -20
- package/script/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_build_message.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_build_message.js +4 -4
- package/script/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_custom_equality_tester.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_equal.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_equal.js +7 -7
- package/script/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_extend.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_inspect_args.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/expect/1.0.7/_matchers.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_matchers.js +30 -31
- package/script/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_mock_util.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_types.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_utils.d.ts +1 -0
- package/script/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_utils.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_utils.js +60 -0
- package/{esm/deps/jsr.io/@std/expect/1.0.6 → script/deps/jsr.io/@std/expect/1.0.7}/expect.d.ts +7 -0
- package/script/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/expect.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/expect.js +69 -4
- 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.4/_mock_utils.d.ts +15 -0
- package/script/deps/jsr.io/@std/testing/1.0.4/_mock_utils.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/testing/1.0.4/_mock_utils.js +41 -0
- package/script/deps/jsr.io/@std/testing/{1.0.3 → 1.0.4}/_test_suite.d.ts +1 -1
- package/{esm/deps/jsr.io/@std/testing/1.0.3 → script/deps/jsr.io/@std/testing/1.0.4}/_test_suite.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/testing/{1.0.3 → 1.0.4}/_test_suite.js +11 -1
- package/script/deps/jsr.io/@std/testing/{1.0.3 → 1.0.4}/bdd.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/testing/{1.0.3 → 1.0.4}/bdd.js +8 -3
- package/script/deps/jsr.io/@std/testing/{1.0.3 → 1.0.4}/mock.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/testing/{1.0.3 → 1.0.4}/mock.js +20 -54
- package/script/src/ast/nodes/annotation.test.js +2 -2
- package/script/src/ast/nodes/argument.test.js +2 -2
- package/script/src/ast/nodes/call.test.js +2 -2
- package/script/src/ast/nodes/class.test.js +2 -2
- package/script/src/ast/nodes/constructor.test.js +2 -2
- package/script/src/ast/nodes/doc-tag.test.js +2 -2
- package/script/src/ast/nodes/doc.test.js +2 -2
- package/script/src/ast/nodes/enum-value.test.js +2 -2
- package/script/src/ast/nodes/enum.test.js +2 -2
- package/script/src/ast/nodes/function.test.js +2 -2
- package/script/src/ast/nodes/generic-parameter.test.js +2 -2
- package/script/src/ast/nodes/init-block.test.js +2 -2
- package/script/src/ast/nodes/interface.test.js +2 -2
- package/script/src/ast/nodes/object.test.js +2 -2
- package/script/src/ast/nodes/parameter.test.js +2 -2
- package/script/src/ast/nodes/property.test.js +2 -2
- package/script/src/ast/nodes/reference.test.js +2 -2
- package/script/src/ast/nodes/string.test.js +2 -2
- package/script/src/generators/services/spring-controllers/spring-controller-generator.d.ts.map +1 -1
- package/script/src/generators/services/spring-controllers/spring-controller-generator.js +11 -7
- package/script/src/import-collection.test.js +2 -2
- package/script/tests/openapi-models.test.js +2 -2
- package/src/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/equals.ts +4 -4
- package/src/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/is_error.ts +2 -2
- package/src/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/not_strict_equals.ts +1 -1
- package/src/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/strict_equals.ts +5 -5
- package/src/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_assert_equals.ts +1 -1
- package/src/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_assert_not_equals.ts +1 -1
- package/src/deps/jsr.io/@std/expect/{1.0.6/_assertion.ts → 1.0.7/_assertions.ts} +6 -1
- package/src/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_asymmetric_matchers.ts +37 -21
- package/src/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_build_message.ts +4 -4
- package/src/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_equal.ts +9 -8
- package/src/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_matchers.ts +42 -38
- package/src/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_utils.ts +82 -0
- package/src/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/expect.ts +74 -2
- package/src/deps/jsr.io/@std/internal/1.0.5/assertion_state.ts +214 -0
- package/src/deps/jsr.io/@std/testing/1.0.4/_mock_utils.ts +43 -0
- package/src/deps/jsr.io/@std/testing/{1.0.3 → 1.0.4}/_test_suite.ts +22 -1
- package/src/deps/jsr.io/@std/testing/{1.0.3 → 1.0.4}/bdd.ts +12 -3
- package/src/deps/jsr.io/@std/testing/{1.0.3 → 1.0.4}/mock.ts +10 -42
- package/src/src/ast/nodes/annotation.test.ts +2 -2
- package/src/src/ast/nodes/argument.test.ts +2 -2
- package/src/src/ast/nodes/call.test.ts +2 -2
- package/src/src/ast/nodes/class.test.ts +2 -2
- package/src/src/ast/nodes/constructor.test.ts +2 -2
- package/src/src/ast/nodes/doc-tag.test.ts +2 -2
- package/src/src/ast/nodes/doc.test.ts +2 -2
- package/src/src/ast/nodes/enum-value.test.ts +2 -2
- package/src/src/ast/nodes/enum.test.ts +2 -2
- package/src/src/ast/nodes/function.test.ts +2 -2
- package/src/src/ast/nodes/generic-parameter.test.ts +2 -2
- package/src/src/ast/nodes/init-block.test.ts +2 -2
- package/src/src/ast/nodes/interface.test.ts +2 -2
- package/src/src/ast/nodes/object.test.ts +2 -2
- package/src/src/ast/nodes/parameter.test.ts +2 -2
- package/src/src/ast/nodes/property.test.ts +2 -2
- package/src/src/ast/nodes/reference.test.ts +2 -2
- package/src/src/ast/nodes/string.test.ts +2 -2
- package/src/src/generators/services/spring-controllers/spring-controller-generator.ts +5 -1
- package/src/src/import-collection.test.ts +2 -2
- package/src/tests/openapi-models.test.ts +2 -2
- 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/expect/1.0.6/_assertion.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.6/_asymmetric_matchers.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.6/_matchers.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/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/expect/1.0.6/_assertion.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.6/_asymmetric_matchers.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.6/_matchers.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/src/deps/jsr.io/@std/assert/1.0.6/object_match.ts +0 -202
- 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.7}/assertion_error.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/assertion_error.js +0 -0
- /package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/equal.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/equal.js +0 -0
- /package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/equals.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/false.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/false.js +0 -0
- /package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/instance_of.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/instance_of.js +0 -0
- /package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/is_error.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/match.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/match.js +0 -0
- /package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/not_instance_of.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/not_instance_of.js +0 -0
- /package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/not_match.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/not_match.js +0 -0
- /package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/not_strict_equals.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/rejects.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/rejects.js +0 -0
- /package/esm/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/strict_equals.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_assert_equals.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_assert_not_equals.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_build_message.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_custom_equality_tester.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_custom_equality_tester.js +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_equal.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_extend.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_extend.js +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_inspect_args.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_inspect_args.js +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_matchers.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_mock_util.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_mock_util.js +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_types.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_types.js +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/esm/deps/jsr.io/@std/testing/{1.0.3 → 1.0.4}/bdd.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/testing/{1.0.3 → 1.0.4}/mock.d.ts +0 -0
- /package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/assertion_error.d.ts +0 -0
- /package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/assertion_error.js +0 -0
- /package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/equal.d.ts +0 -0
- /package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/equal.js +0 -0
- /package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/equals.d.ts +0 -0
- /package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/false.d.ts +0 -0
- /package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/false.js +0 -0
- /package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/instance_of.d.ts +0 -0
- /package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/instance_of.js +0 -0
- /package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/is_error.d.ts +0 -0
- /package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/match.d.ts +0 -0
- /package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/match.js +0 -0
- /package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/not_instance_of.d.ts +0 -0
- /package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/not_instance_of.js +0 -0
- /package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/not_match.d.ts +0 -0
- /package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/not_match.js +0 -0
- /package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/not_strict_equals.d.ts +0 -0
- /package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/rejects.d.ts +0 -0
- /package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/rejects.js +0 -0
- /package/script/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/strict_equals.d.ts +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_assert_equals.d.ts +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_assert_not_equals.d.ts +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_build_message.d.ts +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_custom_equality_tester.d.ts +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_custom_equality_tester.js +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_equal.d.ts +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_extend.d.ts +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_extend.js +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_inspect_args.d.ts +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_inspect_args.js +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_matchers.d.ts +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_mock_util.d.ts +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_mock_util.js +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_types.d.ts +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_types.js +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/script/deps/jsr.io/@std/testing/{1.0.3 → 1.0.4}/bdd.d.ts +0 -0
- /package/script/deps/jsr.io/@std/testing/{1.0.3 → 1.0.4}/mock.d.ts +0 -0
- /package/src/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/assertion_error.ts +0 -0
- /package/src/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/equal.ts +0 -0
- /package/src/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/false.ts +0 -0
- /package/src/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/instance_of.ts +0 -0
- /package/src/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/match.ts +0 -0
- /package/src/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/not_instance_of.ts +0 -0
- /package/src/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/not_match.ts +0 -0
- /package/src/deps/jsr.io/@std/assert/{1.0.6 → 1.0.7}/rejects.ts +0 -0
- /package/src/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_custom_equality_tester.ts +0 -0
- /package/src/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_extend.ts +0 -0
- /package/src/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_inspect_args.ts +0 -0
- /package/src/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_mock_util.ts +0 -0
- /package/src/deps/jsr.io/@std/expect/{1.0.6 → 1.0.7}/_types.ts +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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
2
2
|
|
|
3
|
-
import { getAssertionState } from "../../internal/1.0.
|
|
3
|
+
import { getAssertionState } from "../../internal/1.0.5/assertion_state.js";
|
|
4
4
|
|
|
5
5
|
const assertionState = getAssertionState();
|
|
6
6
|
|
|
@@ -8,6 +8,11 @@ export function hasAssertions() {
|
|
|
8
8
|
assertionState.setAssertionCheck(true);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
export function assertions(num: number) {
|
|
12
|
+
assertionState.setAssertionCount(num);
|
|
13
|
+
}
|
|
14
|
+
|
|
11
15
|
export function emitAssertionTrigger() {
|
|
12
16
|
assertionState.setAssertionTriggered(true);
|
|
17
|
+
assertionState.updateAssertionTriggerCount();
|
|
13
18
|
}
|
|
@@ -6,6 +6,7 @@ import { equal } from "./_equal.js";
|
|
|
6
6
|
export abstract class AsymmetricMatcher<T> {
|
|
7
7
|
constructor(
|
|
8
8
|
protected value: T,
|
|
9
|
+
protected inverse: boolean = false,
|
|
9
10
|
) {}
|
|
10
11
|
abstract equals(other: unknown): boolean;
|
|
11
12
|
}
|
|
@@ -69,12 +70,14 @@ export function any(c: unknown): Any {
|
|
|
69
70
|
}
|
|
70
71
|
|
|
71
72
|
export class ArrayContaining extends AsymmetricMatcher<any[]> {
|
|
72
|
-
constructor(arr: any[]) {
|
|
73
|
-
super(arr);
|
|
73
|
+
constructor(arr: any[], inverse = false) {
|
|
74
|
+
super(arr, inverse);
|
|
74
75
|
}
|
|
75
76
|
|
|
76
77
|
equals(other: any[]): boolean {
|
|
77
|
-
|
|
78
|
+
const res = Array.isArray(other) &&
|
|
79
|
+
this.value.every((e) => other.includes(e));
|
|
80
|
+
return this.inverse ? !res : res;
|
|
78
81
|
}
|
|
79
82
|
}
|
|
80
83
|
|
|
@@ -82,6 +85,10 @@ export function arrayContaining(c: any[]): ArrayContaining {
|
|
|
82
85
|
return new ArrayContaining(c);
|
|
83
86
|
}
|
|
84
87
|
|
|
88
|
+
export function arrayNotContaining(c: any[]): ArrayContaining {
|
|
89
|
+
return new ArrayContaining(c, true);
|
|
90
|
+
}
|
|
91
|
+
|
|
85
92
|
export class CloseTo extends AsymmetricMatcher<number> {
|
|
86
93
|
readonly #precision: number;
|
|
87
94
|
|
|
@@ -113,16 +120,13 @@ export function closeTo(num: number, numDigits?: number): CloseTo {
|
|
|
113
120
|
}
|
|
114
121
|
|
|
115
122
|
export class StringContaining extends AsymmetricMatcher<string> {
|
|
116
|
-
constructor(str: string) {
|
|
117
|
-
super(str);
|
|
123
|
+
constructor(str: string, inverse = false) {
|
|
124
|
+
super(str, inverse);
|
|
118
125
|
}
|
|
119
126
|
|
|
120
127
|
equals(other: string): boolean {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
return other.includes(this.value);
|
|
128
|
+
const res = typeof other !== "string" ? false : other.includes(this.value);
|
|
129
|
+
return this.inverse ? !res : res;
|
|
126
130
|
}
|
|
127
131
|
}
|
|
128
132
|
|
|
@@ -130,17 +134,18 @@ export function stringContaining(str: string): StringContaining {
|
|
|
130
134
|
return new StringContaining(str);
|
|
131
135
|
}
|
|
132
136
|
|
|
137
|
+
export function stringNotContaining(str: string): StringContaining {
|
|
138
|
+
return new StringContaining(str, true);
|
|
139
|
+
}
|
|
140
|
+
|
|
133
141
|
export class StringMatching extends AsymmetricMatcher<RegExp> {
|
|
134
|
-
constructor(pattern: string | RegExp) {
|
|
135
|
-
super(new RegExp(pattern));
|
|
142
|
+
constructor(pattern: string | RegExp, inverse = false) {
|
|
143
|
+
super(new RegExp(pattern), inverse);
|
|
136
144
|
}
|
|
137
145
|
|
|
138
146
|
equals(other: string): boolean {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
return this.value.test(other);
|
|
147
|
+
const res = typeof other !== "string" ? false : this.value.test(other);
|
|
148
|
+
return this.inverse ? !res : res;
|
|
144
149
|
}
|
|
145
150
|
}
|
|
146
151
|
|
|
@@ -148,25 +153,30 @@ export function stringMatching(pattern: string | RegExp): StringMatching {
|
|
|
148
153
|
return new StringMatching(pattern);
|
|
149
154
|
}
|
|
150
155
|
|
|
156
|
+
export function stringNotMatching(pattern: string | RegExp): StringMatching {
|
|
157
|
+
return new StringMatching(pattern, true);
|
|
158
|
+
}
|
|
159
|
+
|
|
151
160
|
export class ObjectContaining
|
|
152
161
|
extends AsymmetricMatcher<Record<string, unknown>> {
|
|
153
|
-
constructor(obj: Record<string, unknown
|
|
154
|
-
super(obj);
|
|
162
|
+
constructor(obj: Record<string, unknown>, inverse = false) {
|
|
163
|
+
super(obj, inverse);
|
|
155
164
|
}
|
|
156
165
|
|
|
157
166
|
equals(other: Record<string, unknown>): boolean {
|
|
158
167
|
const keys = Object.keys(this.value);
|
|
168
|
+
let res = true;
|
|
159
169
|
|
|
160
170
|
for (const key of keys) {
|
|
161
171
|
if (
|
|
162
172
|
!Object.hasOwn(other, key) ||
|
|
163
173
|
!equal(this.value[key], other[key])
|
|
164
174
|
) {
|
|
165
|
-
|
|
175
|
+
res = false;
|
|
166
176
|
}
|
|
167
177
|
}
|
|
168
178
|
|
|
169
|
-
return
|
|
179
|
+
return this.inverse ? !res : res;
|
|
170
180
|
}
|
|
171
181
|
}
|
|
172
182
|
|
|
@@ -175,3 +185,9 @@ export function objectContaining(
|
|
|
175
185
|
): ObjectContaining {
|
|
176
186
|
return new ObjectContaining(obj);
|
|
177
187
|
}
|
|
188
|
+
|
|
189
|
+
export function objectNotContaining(
|
|
190
|
+
obj: Record<string, unknown>,
|
|
191
|
+
): ObjectContaining {
|
|
192
|
+
return new ObjectContaining(obj, true);
|
|
193
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
2
2
|
|
|
3
|
-
import { buildMessage } from "../../internal/1.0.
|
|
4
|
-
import { diff } from "../../internal/1.0.
|
|
5
|
-
import { diffStr } from "../../internal/1.0.
|
|
6
|
-
import { format } from "../../internal/1.0.
|
|
3
|
+
import { buildMessage } from "../../internal/1.0.5/build_message.js";
|
|
4
|
+
import { diff } from "../../internal/1.0.5/diff.js";
|
|
5
|
+
import { diffStr } from "../../internal/1.0.5/diff_str.js";
|
|
6
|
+
import { format } from "../../internal/1.0.5/format.js";
|
|
7
7
|
import type { EqualOptions } from "./_types.js";
|
|
8
8
|
|
|
9
9
|
type EqualErrorMessageOptions = Pick<
|
|
@@ -44,6 +44,11 @@ export function equal(c: unknown, d: unknown, options?: EqualOptions): boolean {
|
|
|
44
44
|
const seen = new Map();
|
|
45
45
|
|
|
46
46
|
return (function compare(a: unknown, b: unknown): boolean {
|
|
47
|
+
const asymmetric = asymmetricEqual(a, b);
|
|
48
|
+
if (asymmetric !== undefined) {
|
|
49
|
+
return asymmetric;
|
|
50
|
+
}
|
|
51
|
+
|
|
47
52
|
if (customTesters?.length) {
|
|
48
53
|
for (const customTester of customTesters) {
|
|
49
54
|
const testContext = {
|
|
@@ -67,11 +72,6 @@ export function equal(c: unknown, d: unknown, options?: EqualOptions): boolean {
|
|
|
67
72
|
return String(a) === String(b);
|
|
68
73
|
}
|
|
69
74
|
|
|
70
|
-
const asymmetric = asymmetricEqual(a, b);
|
|
71
|
-
if (asymmetric !== undefined) {
|
|
72
|
-
return asymmetric;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
75
|
if (a instanceof Date && b instanceof Date) {
|
|
76
76
|
const aTime = a.getTime();
|
|
77
77
|
const bTime = b.getTime();
|
|
@@ -119,6 +119,10 @@ export function equal(c: unknown, d: unknown, options?: EqualOptions): boolean {
|
|
|
119
119
|
let aLen = aKeys.length;
|
|
120
120
|
let bLen = bKeys.length;
|
|
121
121
|
|
|
122
|
+
if (strictCheck && aLen !== bLen) {
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
|
|
122
126
|
if (!strictCheck) {
|
|
123
127
|
if (aLen > 0) {
|
|
124
128
|
for (let i = 0; i < aKeys.length; i += 1) {
|
|
@@ -145,9 +149,6 @@ export function equal(c: unknown, d: unknown, options?: EqualOptions): boolean {
|
|
|
145
149
|
}
|
|
146
150
|
}
|
|
147
151
|
|
|
148
|
-
if (aLen !== bLen) {
|
|
149
|
-
return false;
|
|
150
|
-
}
|
|
151
152
|
seen.set(a, b);
|
|
152
153
|
if (isKeyedCollection(a) && isKeyedCollection(b)) {
|
|
153
154
|
if (a.size !== b.size) {
|
|
@@ -1,23 +1,26 @@
|
|
|
1
1
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
2
2
|
|
|
3
|
-
import { assertNotStrictEquals } from "../../assert/1.0.
|
|
4
|
-
import { assertStrictEquals } from "../../assert/1.0.
|
|
5
|
-
import { assertInstanceOf } from "../../assert/1.0.
|
|
6
|
-
import { assertIsError } from "../../assert/1.0.
|
|
7
|
-
import { assertNotInstanceOf } from "../../assert/1.0.
|
|
8
|
-
import { assertMatch } from "../../assert/1.0.
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { AssertionError } from "../../assert/1.0.6/assertion_error.js";
|
|
3
|
+
import { assertNotStrictEquals } from "../../assert/1.0.7/not_strict_equals.js";
|
|
4
|
+
import { assertStrictEquals } from "../../assert/1.0.7/strict_equals.js";
|
|
5
|
+
import { assertInstanceOf } from "../../assert/1.0.7/instance_of.js";
|
|
6
|
+
import { assertIsError } from "../../assert/1.0.7/is_error.js";
|
|
7
|
+
import { assertNotInstanceOf } from "../../assert/1.0.7/not_instance_of.js";
|
|
8
|
+
import { assertMatch } from "../../assert/1.0.7/match.js";
|
|
9
|
+
import { assertNotMatch } from "../../assert/1.0.7/not_match.js";
|
|
10
|
+
import { AssertionError } from "../../assert/1.0.7/assertion_error.js";
|
|
12
11
|
|
|
13
12
|
import { assertEquals } from "./_assert_equals.js";
|
|
14
13
|
import { assertNotEquals } from "./_assert_not_equals.js";
|
|
15
14
|
import { equal } from "./_equal.js";
|
|
16
|
-
import { format } from "../../internal/1.0.
|
|
15
|
+
import { format } from "../../internal/1.0.5/format.js";
|
|
17
16
|
import type { AnyConstructor, MatcherContext, MatchResult } from "./_types.js";
|
|
18
17
|
import { getMockCalls } from "./_mock_util.js";
|
|
19
18
|
import { inspectArg, inspectArgs } from "./_inspect_args.js";
|
|
20
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
buildEqualOptions,
|
|
21
|
+
iterableEquality,
|
|
22
|
+
subsetEquality,
|
|
23
|
+
} from "./_utils.js";
|
|
21
24
|
|
|
22
25
|
export function toBe(context: MatcherContext, expect: unknown): MatchResult {
|
|
23
26
|
if (context.isNot) {
|
|
@@ -462,34 +465,35 @@ export function toMatchObject(
|
|
|
462
465
|
context: MatcherContext,
|
|
463
466
|
expected: Record<PropertyKey, unknown> | Record<PropertyKey, unknown>[],
|
|
464
467
|
): MatchResult {
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
context.value as Record<PropertyKey, any>,
|
|
490
|
-
expected as Record<PropertyKey, unknown>,
|
|
491
|
-
context.customMessage,
|
|
468
|
+
const received = context.value;
|
|
469
|
+
|
|
470
|
+
if (typeof received !== "object" || received === null) {
|
|
471
|
+
throw new AssertionError("Received value must be an object");
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
if (typeof expected !== "object" || expected === null) {
|
|
475
|
+
throw new AssertionError("Received value must be an object");
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
const pass = equal(context.value, expected, {
|
|
479
|
+
strictCheck: false,
|
|
480
|
+
customTesters: [
|
|
481
|
+
...context.customTesters,
|
|
482
|
+
iterableEquality,
|
|
483
|
+
subsetEquality,
|
|
484
|
+
],
|
|
485
|
+
});
|
|
486
|
+
|
|
487
|
+
const triggerError = () => {
|
|
488
|
+
const actualString = format(context.value);
|
|
489
|
+
const expectedString = format(expected);
|
|
490
|
+
throw new AssertionError(
|
|
491
|
+
`Expected ${actualString} to NOT match ${expectedString}`,
|
|
492
492
|
);
|
|
493
|
+
};
|
|
494
|
+
|
|
495
|
+
if (context.isNot && pass || !context.isNot && !pass) {
|
|
496
|
+
triggerError();
|
|
493
497
|
}
|
|
494
498
|
}
|
|
495
499
|
|
|
@@ -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
|
+
}
|
|
@@ -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.7/assertion_error.js";
|
|
17
|
+
import {
|
|
18
|
+
assertions,
|
|
19
|
+
emitAssertionTrigger,
|
|
20
|
+
hasAssertions,
|
|
21
|
+
} from "./_assertions.js";
|
|
18
22
|
import {
|
|
19
23
|
addCustomEqualityTesters,
|
|
20
24
|
getCustomEqualityTesters,
|
|
@@ -491,6 +495,7 @@ expect.stringContaining = asymmetricMatchers.stringContaining as (
|
|
|
491
495
|
expect.stringMatching = asymmetricMatchers.stringMatching as (
|
|
492
496
|
pattern: string | RegExp,
|
|
493
497
|
) => ReturnType<typeof asymmetricMatchers.stringMatching>;
|
|
498
|
+
|
|
494
499
|
/**
|
|
495
500
|
* `expect.hasAssertions` verifies that at least one assertion is called during a test.
|
|
496
501
|
*
|
|
@@ -509,6 +514,26 @@ expect.stringMatching = asymmetricMatchers.stringMatching as (
|
|
|
509
514
|
* ```
|
|
510
515
|
*/
|
|
511
516
|
expect.hasAssertions = hasAssertions as () => void;
|
|
517
|
+
|
|
518
|
+
/**
|
|
519
|
+
* `expect.assertions` verifies that a certain number of assertions are called during a test.
|
|
520
|
+
*
|
|
521
|
+
* Note: expect.assertions only can use in bdd function test suite, such as `test` or `it`.
|
|
522
|
+
*
|
|
523
|
+
* @example
|
|
524
|
+
* ```ts
|
|
525
|
+
*
|
|
526
|
+
* import { test } from "@std/testing/bdd";
|
|
527
|
+
* import { expect } from "@std/expect";
|
|
528
|
+
*
|
|
529
|
+
* test("it works", () => {
|
|
530
|
+
* expect.assertions(1);
|
|
531
|
+
* expect("a").not.toBe("b");
|
|
532
|
+
* });
|
|
533
|
+
* ```
|
|
534
|
+
*/
|
|
535
|
+
expect.assertions = assertions as (num: number) => void;
|
|
536
|
+
|
|
512
537
|
/**
|
|
513
538
|
* `expect.objectContaining(object)` matches any received object that recursively matches the expected properties.
|
|
514
539
|
* That is, the expected object is not a subset of the received object. Therefore, it matches a received object
|
|
@@ -527,3 +552,50 @@ expect.hasAssertions = hasAssertions as () => void;
|
|
|
527
552
|
expect.objectContaining = asymmetricMatchers.objectContaining as (
|
|
528
553
|
obj: Record<string, unknown>,
|
|
529
554
|
) => ReturnType<typeof asymmetricMatchers.objectContaining>;
|
|
555
|
+
/**
|
|
556
|
+
* `expect.not.arrayContaining` matches a received array which does not contain
|
|
557
|
+
* all of the elements in the expected array. That is, the expected array is not
|
|
558
|
+
* a subset of the received array.
|
|
559
|
+
*
|
|
560
|
+
* `expect.not.objectContaining` matches any received object that does not recursively
|
|
561
|
+
* match the expected properties. That is, the expected object is not a subset of the
|
|
562
|
+
* received object. Therefore, it matches a received object which contains properties
|
|
563
|
+
* that are not in the expected object.
|
|
564
|
+
*
|
|
565
|
+
* `expect.not.stringContaining` matches the received value if it is not a string
|
|
566
|
+
* or if it is a string that does not contain the exact expected string.
|
|
567
|
+
*
|
|
568
|
+
* `expect.not.stringMatching` matches the received value if it is not a string
|
|
569
|
+
* or if it is a string that does not match the expected string or regular expression.
|
|
570
|
+
*
|
|
571
|
+
* @example
|
|
572
|
+
* ```ts
|
|
573
|
+
* import { expect } from "@std/expect";
|
|
574
|
+
*
|
|
575
|
+
* Deno.test("expect.not.arrayContaining", () => {
|
|
576
|
+
* const expected = ["Samantha"];
|
|
577
|
+
* expect(["Alice", "Bob", "Eve"]).toEqual(expect.not.arrayContaining(expected));
|
|
578
|
+
* });
|
|
579
|
+
*
|
|
580
|
+
* Deno.test("expect.not.objectContaining", () => {
|
|
581
|
+
* const expected = { foo: "bar" };
|
|
582
|
+
* expect({ bar: "baz" }).toEqual(expect.not.objectContaining(expected));
|
|
583
|
+
* });
|
|
584
|
+
*
|
|
585
|
+
* Deno.test("expect.not.stringContaining", () => {
|
|
586
|
+
* const expected = "Hello world!";
|
|
587
|
+
* expect("How are you?").toEqual(expect.not.stringContaining(expected));
|
|
588
|
+
* });
|
|
589
|
+
*
|
|
590
|
+
* Deno.test("expect.not.stringMatching", () => {
|
|
591
|
+
* const expected = /Hello world!/;
|
|
592
|
+
* expect("How are you?").toEqual(expect.not.stringMatching(expected));
|
|
593
|
+
* });
|
|
594
|
+
* ```
|
|
595
|
+
*/
|
|
596
|
+
expect.not = {
|
|
597
|
+
arrayContaining: asymmetricMatchers.arrayNotContaining,
|
|
598
|
+
objectContaining: asymmetricMatchers.objectNotContaining,
|
|
599
|
+
stringContaining: asymmetricMatchers.stringNotContaining,
|
|
600
|
+
stringMatching: asymmetricMatchers.stringNotMatching,
|
|
601
|
+
};
|