@goast/core 0.4.1 → 0.5.0-beta.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/LICENSE +21 -21
- package/esm/mod.d.ts +1 -0
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +1 -0
- package/esm/src/codegen/config.d.ts +11 -0
- package/esm/src/codegen/config.d.ts.map +1 -1
- package/esm/src/codegen/config.js +1 -0
- package/esm/src/transform/helpers.d.ts.map +1 -1
- package/esm/src/transform/helpers.js +5 -1
- package/esm/src/utils/file-system.utils.d.ts +2 -0
- package/esm/src/utils/file-system.utils.d.ts.map +1 -1
- package/esm/src/utils/file-system.utils.js +11 -1
- package/esm/src/utils/schema.utils.d.ts +1 -0
- package/esm/src/utils/schema.utils.d.ts.map +1 -1
- package/esm/src/utils/schema.utils.js +5 -0
- package/esm/src/utils/source-builder.d.ts +2 -0
- package/esm/src/utils/source-builder.d.ts.map +1 -1
- package/esm/src/utils/source-builder.js +7 -1
- package/package.json +2 -5
- package/script/mod.d.ts +1 -0
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +1 -0
- package/script/src/codegen/config.d.ts +11 -0
- package/script/src/codegen/config.d.ts.map +1 -1
- package/script/src/codegen/config.js +1 -0
- package/script/src/transform/helpers.d.ts.map +1 -1
- package/script/src/transform/helpers.js +5 -1
- package/script/src/utils/file-system.utils.d.ts +2 -0
- package/script/src/utils/file-system.utils.d.ts.map +1 -1
- package/script/src/utils/file-system.utils.js +11 -0
- package/script/src/utils/schema.utils.d.ts +1 -0
- package/script/src/utils/schema.utils.d.ts.map +1 -1
- package/script/src/utils/schema.utils.js +6 -0
- package/script/src/utils/source-builder.d.ts +2 -0
- package/script/src/utils/source-builder.d.ts.map +1 -1
- package/script/src/utils/source-builder.js +8 -1
- package/esm/_dnt.test_polyfills.d.ts +0 -29
- package/esm/_dnt.test_polyfills.d.ts.map +0 -1
- package/esm/_dnt.test_polyfills.js +0 -31
- package/esm/_dnt.test_shims.d.ts +0 -14
- package/esm/_dnt.test_shims.d.ts.map +0 -1
- package/esm/_dnt.test_shims.js +0 -69
- package/esm/deps/jsr.io/@std/assert/1.0.11/assertion_error.d.ts +0 -26
- package/esm/deps/jsr.io/@std/assert/1.0.11/assertion_error.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.11/assertion_error.js +0 -30
- package/esm/deps/jsr.io/@std/assert/1.0.11/false.d.ts +0 -18
- package/esm/deps/jsr.io/@std/assert/1.0.11/false.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.11/false.js +0 -22
- package/esm/deps/jsr.io/@std/assert/1.0.11/instance_of.d.ts +0 -23
- package/esm/deps/jsr.io/@std/assert/1.0.11/instance_of.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.11/instance_of.js +0 -53
- package/esm/deps/jsr.io/@std/assert/1.0.11/match.d.ts +0 -18
- package/esm/deps/jsr.io/@std/assert/1.0.11/match.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.11/match.js +0 -26
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_instance_of.d.ts +0 -20
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_instance_of.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_instance_of.js +0 -29
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_match.d.ts +0 -18
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_match.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_match.js +0 -26
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.d.ts +0 -23
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.js +0 -32
- package/esm/deps/jsr.io/@std/assert/1.0.11/strict_equals.d.ts +0 -24
- package/esm/deps/jsr.io/@std/assert/1.0.11/strict_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.11/strict_equals.js +0 -57
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_equals.d.ts +0 -20
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_equals.js +0 -29
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_is_error.d.ts +0 -14
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_is_error.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_is_error.js +0 -43
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_not_equals.d.ts +0 -17
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_not_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_not_equals.js +0 -26
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assertions.d.ts +0 -4
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assertions.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assertions.js +0 -13
- package/esm/deps/jsr.io/@std/expect/1.0.12/_asymmetric_matchers.d.ts +0 -46
- package/esm/deps/jsr.io/@std/expect/1.0.12/_asymmetric_matchers.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_asymmetric_matchers.js +0 -161
- package/esm/deps/jsr.io/@std/expect/1.0.12/_build_message.d.ts +0 -6
- package/esm/deps/jsr.io/@std/expect/1.0.12/_build_message.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_build_message.js +0 -29
- package/esm/deps/jsr.io/@std/expect/1.0.12/_custom_equality_tester.d.ts +0 -4
- package/esm/deps/jsr.io/@std/expect/1.0.12/_custom_equality_tester.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_custom_equality_tester.js +0 -11
- package/esm/deps/jsr.io/@std/expect/1.0.12/_equal.d.ts +0 -9
- package/esm/deps/jsr.io/@std/expect/1.0.12/_equal.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_equal.js +0 -191
- package/esm/deps/jsr.io/@std/expect/1.0.12/_extend.d.ts +0 -4
- package/esm/deps/jsr.io/@std/expect/1.0.12/_extend.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_extend.js +0 -11
- package/esm/deps/jsr.io/@std/expect/1.0.12/_inspect_args.d.ts +0 -3
- package/esm/deps/jsr.io/@std/expect/1.0.12/_inspect_args.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_inspect_args.js +0 -12
- package/esm/deps/jsr.io/@std/expect/1.0.12/_matchers.d.ts +0 -34
- package/esm/deps/jsr.io/@std/expect/1.0.12/_matchers.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_matchers.js +0 -714
- package/esm/deps/jsr.io/@std/expect/1.0.12/_mock_util.d.ts +0 -11
- package/esm/deps/jsr.io/@std/expect/1.0.12/_mock_util.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_mock_util.js +0 -10
- package/esm/deps/jsr.io/@std/expect/1.0.12/_serializer.d.ts +0 -4
- package/esm/deps/jsr.io/@std/expect/1.0.12/_serializer.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_serializer.js +0 -10
- package/esm/deps/jsr.io/@std/expect/1.0.12/_types.d.ts +0 -843
- package/esm/deps/jsr.io/@std/expect/1.0.12/_types.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_types.js +0 -3
- package/esm/deps/jsr.io/@std/expect/1.0.12/_utils.d.ts +0 -9
- package/esm/deps/jsr.io/@std/expect/1.0.12/_utils.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_utils.js +0 -218
- package/esm/deps/jsr.io/@std/expect/1.0.12/expect.d.ts +0 -60
- package/esm/deps/jsr.io/@std/expect/1.0.12/expect.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/expect.js +0 -523
- package/esm/deps/jsr.io/@std/expect/1.0.12/fn.d.ts +0 -29
- package/esm/deps/jsr.io/@std/expect/1.0.12/fn.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/fn.js +0 -85
- package/esm/deps/jsr.io/@std/expect/1.0.12/mod.d.ts +0 -86
- package/esm/deps/jsr.io/@std/expect/1.0.12/mod.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/mod.js +0 -88
- package/esm/deps/jsr.io/@std/internal/1.0.5/assertion_state.d.ts +0 -160
- package/esm/deps/jsr.io/@std/internal/1.0.5/assertion_state.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/assertion_state.js +0 -199
- package/esm/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts +0 -82
- package/esm/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/build_message.js +0 -111
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff.d.ts +0 -140
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff.js +0 -277
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts +0 -99
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff_str.js +0 -180
- package/esm/deps/jsr.io/@std/internal/1.0.5/format.d.ts +0 -2
- package/esm/deps/jsr.io/@std/internal/1.0.5/format.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/format.js +0 -37
- package/esm/deps/jsr.io/@std/internal/1.0.5/styles.d.ts +0 -159
- package/esm/deps/jsr.io/@std/internal/1.0.5/styles.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/styles.js +0 -207
- package/esm/deps/jsr.io/@std/internal/1.0.5/types.d.ts +0 -16
- package/esm/deps/jsr.io/@std/internal/1.0.5/types.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/types.js +0 -2
- package/esm/deps/jsr.io/@std/testing/1.0.9/_test_suite.d.ts +0 -79
- package/esm/deps/jsr.io/@std/testing/1.0.9/_test_suite.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/testing/1.0.9/_test_suite.js +0 -380
- package/esm/deps/jsr.io/@std/testing/1.0.9/bdd.d.ts +0 -738
- package/esm/deps/jsr.io/@std/testing/1.0.9/bdd.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/testing/1.0.9/bdd.js +0 -654
- package/esm/src/collect/helpers.test.d.ts +0 -2
- package/esm/src/collect/helpers.test.d.ts.map +0 -1
- package/esm/src/collect/helpers.test.js +0 -77
- package/esm/src/transform/helpers.test.d.ts +0 -2
- package/esm/src/transform/helpers.test.d.ts.map +0 -1
- package/esm/src/transform/helpers.test.js +0 -265
- package/esm/src/utils/action-provider.test.d.ts +0 -2
- package/esm/src/utils/action-provider.test.d.ts.map +0 -1
- package/esm/src/utils/action-provider.test.js +0 -28
- package/esm/src/utils/common.utils.test.d.ts +0 -2
- package/esm/src/utils/common.utils.test.d.ts.map +0 -1
- package/esm/src/utils/common.utils.test.js +0 -18
- package/esm/src/utils/condition.test.d.ts +0 -2
- package/esm/src/utils/condition.test.d.ts.map +0 -1
- package/esm/src/utils/condition.test.js +0 -31
- package/esm/src/utils/endpoint.utils.test.d.ts +0 -2
- package/esm/src/utils/endpoint.utils.test.d.ts.map +0 -1
- package/esm/src/utils/endpoint.utils.test.js +0 -31
- package/esm/src/utils/factory.test.d.ts +0 -2
- package/esm/src/utils/factory.test.d.ts.map +0 -1
- package/esm/src/utils/factory.test.js +0 -34
- package/esm/src/utils/generator.utils.test.d.ts +0 -2
- package/esm/src/utils/generator.utils.test.d.ts.map +0 -1
- package/esm/src/utils/generator.utils.test.js +0 -13
- package/esm/src/utils/object.utils.test.d.ts +0 -2
- package/esm/src/utils/object.utils.test.d.ts.map +0 -1
- package/esm/src/utils/object.utils.test.js +0 -29
- package/esm/src/utils/schema.utils.test.d.ts +0 -2
- package/esm/src/utils/schema.utils.test.d.ts.map +0 -1
- package/esm/src/utils/schema.utils.test.js +0 -70
- package/esm/src/utils/source-builder.test.d.ts +0 -2
- package/esm/src/utils/source-builder.test.d.ts.map +0 -1
- package/esm/src/utils/source-builder.test.js +0 -505
- package/esm/src/utils/string-builder/string-builder.test.d.ts +0 -2
- package/esm/src/utils/string-builder/string-builder.test.d.ts.map +0 -1
- package/esm/src/utils/string-builder/string-builder.test.js +0 -163
- package/esm/src/utils/string.utils.test.d.ts +0 -2
- package/esm/src/utils/string.utils.test.d.ts.map +0 -1
- package/esm/src/utils/string.utils.test.js +0 -528
- package/esm/tests/openapi.test.d.ts +0 -2
- package/esm/tests/openapi.test.d.ts.map +0 -1
- package/esm/tests/openapi.test.js +0 -33
- package/esm/tests/schema-factory.d.ts +0 -42
- package/esm/tests/schema-factory.d.ts.map +0 -1
- package/esm/tests/schema-factory.js +0 -138
- package/script/_dnt.test_polyfills.d.ts +0 -29
- package/script/_dnt.test_polyfills.d.ts.map +0 -1
- package/script/_dnt.test_polyfills.js +0 -32
- package/script/_dnt.test_shims.d.ts +0 -14
- package/script/_dnt.test_shims.d.ts.map +0 -1
- package/script/_dnt.test_shims.js +0 -79
- package/script/deps/jsr.io/@std/assert/1.0.11/assertion_error.d.ts +0 -26
- package/script/deps/jsr.io/@std/assert/1.0.11/assertion_error.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.11/assertion_error.js +0 -34
- package/script/deps/jsr.io/@std/assert/1.0.11/false.d.ts +0 -18
- package/script/deps/jsr.io/@std/assert/1.0.11/false.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.11/false.js +0 -25
- package/script/deps/jsr.io/@std/assert/1.0.11/instance_of.d.ts +0 -23
- package/script/deps/jsr.io/@std/assert/1.0.11/instance_of.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.11/instance_of.js +0 -56
- package/script/deps/jsr.io/@std/assert/1.0.11/match.d.ts +0 -18
- package/script/deps/jsr.io/@std/assert/1.0.11/match.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.11/match.js +0 -29
- package/script/deps/jsr.io/@std/assert/1.0.11/not_instance_of.d.ts +0 -20
- package/script/deps/jsr.io/@std/assert/1.0.11/not_instance_of.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.11/not_instance_of.js +0 -32
- package/script/deps/jsr.io/@std/assert/1.0.11/not_match.d.ts +0 -18
- package/script/deps/jsr.io/@std/assert/1.0.11/not_match.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.11/not_match.js +0 -29
- package/script/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.d.ts +0 -23
- package/script/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.js +0 -35
- package/script/deps/jsr.io/@std/assert/1.0.11/strict_equals.d.ts +0 -24
- package/script/deps/jsr.io/@std/assert/1.0.11/strict_equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.11/strict_equals.js +0 -60
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_equals.d.ts +0 -20
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_equals.js +0 -32
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_is_error.d.ts +0 -14
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_is_error.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_is_error.js +0 -46
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_not_equals.d.ts +0 -17
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_not_equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_not_equals.js +0 -29
- package/script/deps/jsr.io/@std/expect/1.0.12/_assertions.d.ts +0 -4
- package/script/deps/jsr.io/@std/expect/1.0.12/_assertions.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_assertions.js +0 -18
- package/script/deps/jsr.io/@std/expect/1.0.12/_asymmetric_matchers.d.ts +0 -46
- package/script/deps/jsr.io/@std/expect/1.0.12/_asymmetric_matchers.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_asymmetric_matchers.js +0 -183
- package/script/deps/jsr.io/@std/expect/1.0.12/_build_message.d.ts +0 -6
- package/script/deps/jsr.io/@std/expect/1.0.12/_build_message.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_build_message.js +0 -33
- package/script/deps/jsr.io/@std/expect/1.0.12/_custom_equality_tester.d.ts +0 -4
- package/script/deps/jsr.io/@std/expect/1.0.12/_custom_equality_tester.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_custom_equality_tester.js +0 -15
- package/script/deps/jsr.io/@std/expect/1.0.12/_equal.d.ts +0 -9
- package/script/deps/jsr.io/@std/expect/1.0.12/_equal.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_equal.js +0 -194
- package/script/deps/jsr.io/@std/expect/1.0.12/_extend.d.ts +0 -4
- package/script/deps/jsr.io/@std/expect/1.0.12/_extend.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_extend.js +0 -15
- package/script/deps/jsr.io/@std/expect/1.0.12/_inspect_args.d.ts +0 -3
- package/script/deps/jsr.io/@std/expect/1.0.12/_inspect_args.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_inspect_args.js +0 -17
- package/script/deps/jsr.io/@std/expect/1.0.12/_matchers.d.ts +0 -34
- package/script/deps/jsr.io/@std/expect/1.0.12/_matchers.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_matchers.js +0 -748
- package/script/deps/jsr.io/@std/expect/1.0.12/_mock_util.d.ts +0 -11
- package/script/deps/jsr.io/@std/expect/1.0.12/_mock_util.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_mock_util.js +0 -14
- package/script/deps/jsr.io/@std/expect/1.0.12/_serializer.d.ts +0 -4
- package/script/deps/jsr.io/@std/expect/1.0.12/_serializer.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_serializer.js +0 -14
- package/script/deps/jsr.io/@std/expect/1.0.12/_types.d.ts +0 -843
- package/script/deps/jsr.io/@std/expect/1.0.12/_types.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_types.js +0 -4
- package/script/deps/jsr.io/@std/expect/1.0.12/_utils.d.ts +0 -9
- package/script/deps/jsr.io/@std/expect/1.0.12/_utils.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_utils.js +0 -226
- package/script/deps/jsr.io/@std/expect/1.0.12/expect.d.ts +0 -60
- package/script/deps/jsr.io/@std/expect/1.0.12/expect.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/expect.js +0 -527
- package/script/deps/jsr.io/@std/expect/1.0.12/fn.d.ts +0 -29
- package/script/deps/jsr.io/@std/expect/1.0.12/fn.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/fn.js +0 -88
- package/script/deps/jsr.io/@std/expect/1.0.12/mod.d.ts +0 -86
- package/script/deps/jsr.io/@std/expect/1.0.12/mod.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/mod.js +0 -91
- package/script/deps/jsr.io/@std/internal/1.0.5/assertion_state.d.ts +0 -160
- package/script/deps/jsr.io/@std/internal/1.0.5/assertion_state.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.5/assertion_state.js +0 -204
- package/script/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts +0 -82
- package/script/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.5/build_message.js +0 -116
- package/script/deps/jsr.io/@std/internal/1.0.5/diff.d.ts +0 -140
- package/script/deps/jsr.io/@std/internal/1.0.5/diff.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.5/diff.js +0 -284
- package/script/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts +0 -99
- package/script/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.5/diff_str.js +0 -186
- package/script/deps/jsr.io/@std/internal/1.0.5/format.d.ts +0 -2
- package/script/deps/jsr.io/@std/internal/1.0.5/format.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.5/format.js +0 -41
- package/script/deps/jsr.io/@std/internal/1.0.5/styles.d.ts +0 -159
- package/script/deps/jsr.io/@std/internal/1.0.5/styles.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.5/styles.js +0 -220
- package/script/deps/jsr.io/@std/internal/1.0.5/types.d.ts +0 -16
- package/script/deps/jsr.io/@std/internal/1.0.5/types.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.5/types.js +0 -3
- package/script/deps/jsr.io/@std/testing/1.0.9/_test_suite.d.ts +0 -79
- package/script/deps/jsr.io/@std/testing/1.0.9/_test_suite.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/testing/1.0.9/_test_suite.js +0 -385
- package/script/deps/jsr.io/@std/testing/1.0.9/bdd.d.ts +0 -738
- package/script/deps/jsr.io/@std/testing/1.0.9/bdd.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/testing/1.0.9/bdd.js +0 -665
- package/script/src/collect/helpers.test.d.ts +0 -2
- package/script/src/collect/helpers.test.d.ts.map +0 -1
- package/script/src/collect/helpers.test.js +0 -79
- package/script/src/transform/helpers.test.d.ts +0 -2
- package/script/src/transform/helpers.test.d.ts.map +0 -1
- package/script/src/transform/helpers.test.js +0 -267
- package/script/src/utils/action-provider.test.d.ts +0 -2
- package/script/src/utils/action-provider.test.d.ts.map +0 -1
- package/script/src/utils/action-provider.test.js +0 -30
- package/script/src/utils/common.utils.test.d.ts +0 -2
- package/script/src/utils/common.utils.test.d.ts.map +0 -1
- package/script/src/utils/common.utils.test.js +0 -20
- package/script/src/utils/condition.test.d.ts +0 -2
- package/script/src/utils/condition.test.d.ts.map +0 -1
- package/script/src/utils/condition.test.js +0 -33
- package/script/src/utils/endpoint.utils.test.d.ts +0 -2
- package/script/src/utils/endpoint.utils.test.d.ts.map +0 -1
- package/script/src/utils/endpoint.utils.test.js +0 -33
- package/script/src/utils/factory.test.d.ts +0 -2
- package/script/src/utils/factory.test.d.ts.map +0 -1
- package/script/src/utils/factory.test.js +0 -36
- package/script/src/utils/generator.utils.test.d.ts +0 -2
- package/script/src/utils/generator.utils.test.d.ts.map +0 -1
- package/script/src/utils/generator.utils.test.js +0 -15
- package/script/src/utils/object.utils.test.d.ts +0 -2
- package/script/src/utils/object.utils.test.d.ts.map +0 -1
- package/script/src/utils/object.utils.test.js +0 -31
- package/script/src/utils/schema.utils.test.d.ts +0 -2
- package/script/src/utils/schema.utils.test.d.ts.map +0 -1
- package/script/src/utils/schema.utils.test.js +0 -72
- package/script/src/utils/source-builder.test.d.ts +0 -2
- package/script/src/utils/source-builder.test.d.ts.map +0 -1
- package/script/src/utils/source-builder.test.js +0 -507
- package/script/src/utils/string-builder/string-builder.test.d.ts +0 -2
- package/script/src/utils/string-builder/string-builder.test.d.ts.map +0 -1
- package/script/src/utils/string-builder/string-builder.test.js +0 -165
- package/script/src/utils/string.utils.test.d.ts +0 -2
- package/script/src/utils/string.utils.test.d.ts.map +0 -1
- package/script/src/utils/string.utils.test.js +0 -530
- package/script/tests/openapi.test.d.ts +0 -2
- package/script/tests/openapi.test.d.ts.map +0 -1
- package/script/tests/openapi.test.js +0 -35
- package/script/tests/schema-factory.d.ts +0 -42
- package/script/tests/schema-factory.d.ts.map +0 -1
- package/script/tests/schema-factory.js +0 -162
- package/src/_dnt.shims.ts +0 -69
- package/src/_dnt.test_polyfills.ts +0 -70
- package/src/_dnt.test_shims.ts +0 -72
- package/src/deps/jsr.io/@std/assert/1.0.11/assertion_error.ts +0 -31
- package/src/deps/jsr.io/@std/assert/1.0.11/false.ts +0 -26
- package/src/deps/jsr.io/@std/assert/1.0.11/instance_of.ts +0 -64
- package/src/deps/jsr.io/@std/assert/1.0.11/match.ts +0 -30
- package/src/deps/jsr.io/@std/assert/1.0.11/not_instance_of.ts +0 -33
- package/src/deps/jsr.io/@std/assert/1.0.11/not_match.ts +0 -30
- package/src/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.ts +0 -42
- package/src/deps/jsr.io/@std/assert/1.0.11/strict_equals.ts +0 -67
- package/src/deps/jsr.io/@std/expect/1.0.12/_assert_equals.ts +0 -38
- package/src/deps/jsr.io/@std/expect/1.0.12/_assert_is_error.ts +0 -54
- package/src/deps/jsr.io/@std/expect/1.0.12/_assert_not_equals.ts +0 -35
- package/src/deps/jsr.io/@std/expect/1.0.12/_assertions.ts +0 -18
- package/src/deps/jsr.io/@std/expect/1.0.12/_asymmetric_matchers.ts +0 -198
- package/src/deps/jsr.io/@std/expect/1.0.12/_build_message.ts +0 -51
- package/src/deps/jsr.io/@std/expect/1.0.12/_custom_equality_tester.ts +0 -19
- package/src/deps/jsr.io/@std/expect/1.0.12/_equal.ts +0 -230
- package/src/deps/jsr.io/@std/expect/1.0.12/_extend.ts +0 -16
- package/src/deps/jsr.io/@std/expect/1.0.12/_inspect_args.ts +0 -15
- package/src/deps/jsr.io/@std/expect/1.0.12/_matchers.ts +0 -1028
- package/src/deps/jsr.io/@std/expect/1.0.12/_mock_util.ts +0 -22
- package/src/deps/jsr.io/@std/expect/1.0.12/_serializer.ts +0 -15
- package/src/deps/jsr.io/@std/expect/1.0.12/_types.ts +0 -923
- package/src/deps/jsr.io/@std/expect/1.0.12/_utils.ts +0 -283
- package/src/deps/jsr.io/@std/expect/1.0.12/expect.ts +0 -620
- package/src/deps/jsr.io/@std/expect/1.0.12/fn.ts +0 -91
- package/src/deps/jsr.io/@std/expect/1.0.12/mod.ts +0 -89
- package/src/deps/jsr.io/@std/internal/1.0.5/assertion_state.ts +0 -214
- package/src/deps/jsr.io/@std/internal/1.0.5/build_message.ts +0 -134
- package/src/deps/jsr.io/@std/internal/1.0.5/diff.ts +0 -317
- package/src/deps/jsr.io/@std/internal/1.0.5/diff_str.ts +0 -204
- package/src/deps/jsr.io/@std/internal/1.0.5/format.ts +0 -39
- package/src/deps/jsr.io/@std/internal/1.0.5/styles.ts +0 -233
- package/src/deps/jsr.io/@std/internal/1.0.5/types.ts +0 -18
- package/src/deps/jsr.io/@std/testing/1.0.9/_test_suite.ts +0 -448
- package/src/deps/jsr.io/@std/testing/1.0.9/bdd.ts +0 -1288
- package/src/mod.ts +0 -33
- package/src/src/ast/node.ts +0 -46
- package/src/src/codegen/config.ts +0 -28
- package/src/src/codegen/endpoints-generator.ts +0 -72
- package/src/src/codegen/generator.ts +0 -181
- package/src/src/codegen/internal-utils.ts +0 -6
- package/src/src/codegen/schemas-generator.ts +0 -87
- package/src/src/codegen/services-generator.ts +0 -77
- package/src/src/codegen/types.ts +0 -37
- package/src/src/collect/collector.ts +0 -142
- package/src/src/collect/helpers.test.ts +0 -91
- package/src/src/collect/helpers.ts +0 -36
- package/src/src/collect/types.ts +0 -21
- package/src/src/internal-utils.ts +0 -5
- package/src/src/parse/deref-proxy.ts +0 -64
- package/src/src/parse/openapi-types.ts +0 -949
- package/src/src/parse/parser.ts +0 -220
- package/src/src/parse/types.ts +0 -27
- package/src/src/transform/api-types.ts +0 -243
- package/src/src/transform/helpers.test.ts +0 -316
- package/src/src/transform/helpers.ts +0 -211
- package/src/src/transform/transform-document.ts +0 -35
- package/src/src/transform/transform-endpoint.ts +0 -331
- package/src/src/transform/transform-schema.ts +0 -217
- package/src/src/transform/transformer.ts +0 -52
- package/src/src/transform/types.ts +0 -52
- package/src/src/utils/action-provider.test.ts +0 -32
- package/src/src/utils/action-provider.ts +0 -58
- package/src/src/utils/array.utils.ts +0 -7
- package/src/src/utils/asset-manager.ts +0 -51
- package/src/src/utils/class.utils.ts +0 -40
- package/src/src/utils/common.utils.test.ts +0 -22
- package/src/src/utils/common.utils.ts +0 -86
- package/src/src/utils/condition.test.ts +0 -36
- package/src/src/utils/condition.ts +0 -7
- package/src/src/utils/endpoint.utils.test.ts +0 -36
- package/src/src/utils/endpoint.utils.ts +0 -10
- package/src/src/utils/error.utils.ts +0 -3
- package/src/src/utils/factory.test.ts +0 -31
- package/src/src/utils/factory.ts +0 -42
- package/src/src/utils/file-system.utils.ts +0 -48
- package/src/src/utils/generator.utils.test.ts +0 -16
- package/src/src/utils/generator.utils.ts +0 -6
- package/src/src/utils/object.utils.test.ts +0 -33
- package/src/src/utils/object.utils.ts +0 -32
- package/src/src/utils/schema.utils.test.ts +0 -88
- package/src/src/utils/schema.utils.ts +0 -142
- package/src/src/utils/source-builder.test.ts +0 -657
- package/src/src/utils/source-builder.ts +0 -589
- package/src/src/utils/string-builder/options.ts +0 -19
- package/src/src/utils/string-builder/string-builder.test.ts +0 -188
- package/src/src/utils/string-builder/string-builder.ts +0 -165
- package/src/src/utils/string-builder/utils.ts +0 -69
- package/src/src/utils/string.utils.test.ts +0 -691
- package/src/src/utils/string.utils.ts +0 -369
- package/src/src/utils/string.utils.types.ts +0 -179
- package/src/src/utils/type.utils.ts +0 -93
- package/src/tests/openapi.test.ts +0 -50
- package/src/tests/schema-factory.ts +0 -185
- package/test_runner.js +0 -221
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
2
|
-
// Copyright 2019 Allain Lalonde. All rights reserved. ISC License.
|
|
3
|
-
// This module is browser compatible.
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* This module provides Jest compatible expect assertion functionality.
|
|
7
|
-
*
|
|
8
|
-
* ```ts no-assert
|
|
9
|
-
* import { expect } from "@std/expect";
|
|
10
|
-
*
|
|
11
|
-
* const x = 6 * 7;
|
|
12
|
-
* expect(x).toEqual(42);
|
|
13
|
-
* expect(x).not.toEqual(0);
|
|
14
|
-
*
|
|
15
|
-
* await expect(Promise.resolve(x)).resolves.toEqual(42);
|
|
16
|
-
* ```
|
|
17
|
-
*
|
|
18
|
-
* Currently this module supports the following functions:
|
|
19
|
-
* - Common matchers:
|
|
20
|
-
* - {@linkcode Expected.toBe | toBe}
|
|
21
|
-
* - {@linkcode Expected.toEqual | toEqual}
|
|
22
|
-
* - {@linkcode Expected.toStrictEqual | toStrictEqual}
|
|
23
|
-
* - {@linkcode Expected.toMatch | toMatch}
|
|
24
|
-
* - {@linkcode Expected.toMatchObject | toMatchObject}
|
|
25
|
-
* - {@linkcode Expected.toBeDefined | toBeDefined}
|
|
26
|
-
* - {@linkcode Expected.toBeUndefined | toBeUndefined}
|
|
27
|
-
* - {@linkcode Expected.toBeNull | toBeNull}
|
|
28
|
-
* - {@linkcode Expected.toBeNaN | toBeNaN}
|
|
29
|
-
* - {@linkcode Expected.toBeTruthy | toBeTruthy}
|
|
30
|
-
* - {@linkcode Expected.toBeFalsy | toBeFalsy}
|
|
31
|
-
* - {@linkcode Expected.toContain | toContain}
|
|
32
|
-
* - {@linkcode Expected.toContainEqual | toContainEqual}
|
|
33
|
-
* - {@linkcode Expected.toHaveLength | toHaveLength}
|
|
34
|
-
* - {@linkcode Expected.toBeGreaterThan | toBeGreaterThan}
|
|
35
|
-
* - {@linkcode Expected.toBeGreaterThanOrEqual | toBeGreaterThanOrEqual}
|
|
36
|
-
* - {@linkcode Expected.toBeLessThan | toBeLessThan}
|
|
37
|
-
* - {@linkcode Expected.toBeLessThanOrEqual | toBeLessThanOrEqual}
|
|
38
|
-
* - {@linkcode Expected.toBeCloseTo | toBeCloseTo}
|
|
39
|
-
* - {@linkcode Expected.toBeInstanceOf | toBeInstanceOf}
|
|
40
|
-
* - {@linkcode Expected.toThrow | toThrow}
|
|
41
|
-
* - {@linkcode Expected.toHaveProperty | toHaveProperty}
|
|
42
|
-
* - Mock related matchers:
|
|
43
|
-
* - {@linkcode Expected.toHaveBeenCalled | toHaveBeenCalled}
|
|
44
|
-
* - {@linkcode Expected.toHaveBeenCalledTimes | toHaveBeenCalledTimes}
|
|
45
|
-
* - {@linkcode Expected.toHaveBeenCalledWith | toHaveBeenCalledWith}
|
|
46
|
-
* - {@linkcode Expected.toHaveBeenLastCalledWith | toHaveBeenLastCalledWith}
|
|
47
|
-
* - {@linkcode Expected.toHaveBeenNthCalledWith | toHaveBeenNthCalledWith}
|
|
48
|
-
* - {@linkcode Expected.toHaveReturned | toHaveReturned}
|
|
49
|
-
* - {@linkcode Expected.toHaveReturnedTimes | toHaveReturnedTimes}
|
|
50
|
-
* - {@linkcode Expected.toHaveReturnedWith | toHaveReturnedWith}
|
|
51
|
-
* - {@linkcode Expected.toHaveLastReturnedWith | toHaveLastReturnedWith}
|
|
52
|
-
* - {@linkcode Expected.toHaveNthReturnedWith | toHaveNthReturnedWith}
|
|
53
|
-
* - Asymmetric matchers:
|
|
54
|
-
* - {@linkcode expect.anything}
|
|
55
|
-
* - {@linkcode expect.any}
|
|
56
|
-
* - {@linkcode expect.arrayContaining}
|
|
57
|
-
* - {@linkcode expect.not.arrayContaining}
|
|
58
|
-
* - {@linkcode expect.objectContaining}
|
|
59
|
-
* - {@linkcode expect.not.objectContaining}
|
|
60
|
-
* - {@linkcode expect.closeTo}
|
|
61
|
-
* - {@linkcode expect.stringContaining}
|
|
62
|
-
* - {@linkcode expect.not.stringContaining}
|
|
63
|
-
* - {@linkcode expect.stringMatching}
|
|
64
|
-
* - {@linkcode expect.not.stringMatching}
|
|
65
|
-
* - Utilities:
|
|
66
|
-
* - {@linkcode expect.addSnapshotSerializer}
|
|
67
|
-
* - {@linkcode expect.assertions}
|
|
68
|
-
* - {@linkcode expect.addEqualityTester}
|
|
69
|
-
* - {@linkcode expect.extend}
|
|
70
|
-
* - {@linkcode expect.hasAssertions}
|
|
71
|
-
*
|
|
72
|
-
* Only these functions are still not available:
|
|
73
|
-
* - Matchers:
|
|
74
|
-
* - `toMatchSnapshot`
|
|
75
|
-
* - `toMatchInlineSnapshot`
|
|
76
|
-
* - `toThrowErrorMatchingSnapshot`
|
|
77
|
-
* - `toThrowErrorMatchingInlineSnapshot`
|
|
78
|
-
*
|
|
79
|
-
* The tracking issue to add support for unsupported parts of the API is
|
|
80
|
-
* {@link https://github.com/denoland/std/issues/3964}.
|
|
81
|
-
*
|
|
82
|
-
* This module is largely inspired by
|
|
83
|
-
* {@link https://github.com/allain/expect | x/expect} module by
|
|
84
|
-
* {@link https://github.com/allain | Allain Lalonde}.
|
|
85
|
-
*
|
|
86
|
-
* @module
|
|
87
|
-
*/
|
|
88
|
-
export * from "./expect.js";
|
|
89
|
-
export * from "./fn.js";
|
|
@@ -1,214 +0,0 @@
|
|
|
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,134 +0,0 @@
|
|
|
1
|
-
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
2
|
-
// This module is browser compatible.
|
|
3
|
-
|
|
4
|
-
import { bgGreen, bgRed, bold, gray, green, red, white } from "./styles.js";
|
|
5
|
-
import type { DiffResult, DiffType } from "./types.js";
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Colors the output of assertion diffs.
|
|
9
|
-
*
|
|
10
|
-
* @param diffType Difference type, either added or removed.
|
|
11
|
-
* @param background If true, colors the background instead of the text.
|
|
12
|
-
*
|
|
13
|
-
* @returns A function that colors the input string.
|
|
14
|
-
*
|
|
15
|
-
* @example Usage
|
|
16
|
-
* ```ts
|
|
17
|
-
* import { createColor } from "@std/internal";
|
|
18
|
-
* import { assertEquals } from "@std/assert";
|
|
19
|
-
* import { bold, green, red, white } from "@std/fmt/colors";
|
|
20
|
-
*
|
|
21
|
-
* assertEquals(createColor("added")("foo"), green(bold("foo")));
|
|
22
|
-
* assertEquals(createColor("removed")("foo"), red(bold("foo")));
|
|
23
|
-
* assertEquals(createColor("common")("foo"), white("foo"));
|
|
24
|
-
* ```
|
|
25
|
-
*/
|
|
26
|
-
export function createColor(
|
|
27
|
-
diffType: DiffType,
|
|
28
|
-
/**
|
|
29
|
-
* TODO(@littledivy): Remove this when we can detect true color terminals. See
|
|
30
|
-
* https://github.com/denoland/deno_std/issues/2575.
|
|
31
|
-
*/
|
|
32
|
-
background = false,
|
|
33
|
-
): (s: string) => string {
|
|
34
|
-
switch (diffType) {
|
|
35
|
-
case "added":
|
|
36
|
-
return (s) => background ? bgGreen(white(s)) : green(bold(s));
|
|
37
|
-
case "removed":
|
|
38
|
-
return (s) => background ? bgRed(white(s)) : red(bold(s));
|
|
39
|
-
default:
|
|
40
|
-
return white;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Prefixes `+` or `-` in diff output.
|
|
46
|
-
*
|
|
47
|
-
* @param diffType Difference type, either added or removed
|
|
48
|
-
*
|
|
49
|
-
* @returns A string representing the sign.
|
|
50
|
-
*
|
|
51
|
-
* @example Usage
|
|
52
|
-
* ```ts
|
|
53
|
-
* import { createSign } from "@std/internal";
|
|
54
|
-
* import { assertEquals } from "@std/assert";
|
|
55
|
-
*
|
|
56
|
-
* assertEquals(createSign("added"), "+ ");
|
|
57
|
-
* assertEquals(createSign("removed"), "- ");
|
|
58
|
-
* assertEquals(createSign("common"), " ");
|
|
59
|
-
* ```
|
|
60
|
-
*/
|
|
61
|
-
export function createSign(diffType: DiffType): string {
|
|
62
|
-
switch (diffType) {
|
|
63
|
-
case "added":
|
|
64
|
-
return "+ ";
|
|
65
|
-
case "removed":
|
|
66
|
-
return "- ";
|
|
67
|
-
default:
|
|
68
|
-
return " ";
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/** Options for {@linkcode buildMessage}. */
|
|
73
|
-
export interface BuildMessageOptions {
|
|
74
|
-
/**
|
|
75
|
-
* Whether to output the diff as a single string.
|
|
76
|
-
*
|
|
77
|
-
* @default {false}
|
|
78
|
-
*/
|
|
79
|
-
stringDiff?: boolean;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Builds a message based on the provided diff result.
|
|
84
|
-
*
|
|
85
|
-
* @param diffResult The diff result array.
|
|
86
|
-
* @param options Optional parameters for customizing the message.
|
|
87
|
-
*
|
|
88
|
-
* @returns An array of strings representing the built message.
|
|
89
|
-
*
|
|
90
|
-
* @example Usage
|
|
91
|
-
* ```ts no-assert
|
|
92
|
-
* import { diffStr, buildMessage } from "@std/internal";
|
|
93
|
-
*
|
|
94
|
-
* const diffResult = diffStr("Hello, world!", "Hello, world");
|
|
95
|
-
*
|
|
96
|
-
* console.log(buildMessage(diffResult));
|
|
97
|
-
* // [
|
|
98
|
-
* // "",
|
|
99
|
-
* // "",
|
|
100
|
-
* // " [Diff] Actual / Expected",
|
|
101
|
-
* // "",
|
|
102
|
-
* // "",
|
|
103
|
-
* // "- Hello, world!",
|
|
104
|
-
* // "+ Hello, world",
|
|
105
|
-
* // "",
|
|
106
|
-
* // ]
|
|
107
|
-
* ```
|
|
108
|
-
*/
|
|
109
|
-
export function buildMessage(
|
|
110
|
-
diffResult: ReadonlyArray<DiffResult<string>>,
|
|
111
|
-
options: BuildMessageOptions = {},
|
|
112
|
-
): string[] {
|
|
113
|
-
const { stringDiff = false } = options;
|
|
114
|
-
const messages = [
|
|
115
|
-
"",
|
|
116
|
-
"",
|
|
117
|
-
` ${gray(bold("[Diff]"))} ${red(bold("Actual"))} / ${
|
|
118
|
-
green(bold("Expected"))
|
|
119
|
-
}`,
|
|
120
|
-
"",
|
|
121
|
-
"",
|
|
122
|
-
];
|
|
123
|
-
const diffMessages = diffResult.map((result) => {
|
|
124
|
-
const color = createColor(result.type);
|
|
125
|
-
const line = result.details?.map((detail) =>
|
|
126
|
-
detail.type !== "common"
|
|
127
|
-
? createColor(detail.type, true)(detail.value)
|
|
128
|
-
: detail.value
|
|
129
|
-
).join("") ?? result.value;
|
|
130
|
-
return color(`${createSign(result.type)}${line}`);
|
|
131
|
-
});
|
|
132
|
-
messages.push(...(stringDiff ? [diffMessages.join("")] : diffMessages), "");
|
|
133
|
-
return messages;
|
|
134
|
-
}
|