@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,185 +0,0 @@
|
|
|
1
|
-
import type { ApiSchema, ApiSchemaBase, ApiSchemaComponent, ApiSchemaExtensions, ApiSchemaProperty } from '../mod.js';
|
|
2
|
-
|
|
3
|
-
export type TestSchema =
|
|
4
|
-
& Partial<Omit<ApiSchemaBase, 'required'>>
|
|
5
|
-
& Partial<ApiSchemaComponent>
|
|
6
|
-
& {
|
|
7
|
-
required?: string[];
|
|
8
|
-
};
|
|
9
|
-
export type TestOneofSchema = TestSchema & Partial<Omit<ApiSchemaExtensions<'oneOf'>, 'kind'>>;
|
|
10
|
-
export type TestMultiTypeSchema =
|
|
11
|
-
& TestSchema
|
|
12
|
-
& Partial<Omit<ApiSchemaExtensions<'multi-type'>, 'kind' | 'properties'>>
|
|
13
|
-
& {
|
|
14
|
-
properties?: ApiSchemaProperty[];
|
|
15
|
-
};
|
|
16
|
-
export type TestStringSchema = TestSchema & Partial<Omit<ApiSchemaExtensions<'string'>, 'kind' | 'type'>>;
|
|
17
|
-
export type TestBooleanSchema = TestSchema & Partial<Omit<ApiSchemaExtensions<'boolean'>, 'kind' | 'type'>>;
|
|
18
|
-
export type TestNullSchema = TestSchema & Partial<Omit<ApiSchemaExtensions<'null'>, 'kind' | 'type'>>;
|
|
19
|
-
export type TestNumberSchema = TestSchema & Partial<Omit<ApiSchemaExtensions<'number'>, 'kind' | 'type'>>;
|
|
20
|
-
export type TestIntegerSchema = TestSchema & Partial<Omit<ApiSchemaExtensions<'integer'>, 'kind' | 'type'>>;
|
|
21
|
-
export type TestArraySchema = TestSchema & Partial<Omit<ApiSchemaExtensions<'array'>, 'kind' | 'type'>>;
|
|
22
|
-
export type TestObjectSchema =
|
|
23
|
-
& TestSchema
|
|
24
|
-
& Partial<Omit<ApiSchemaExtensions<'object'>, 'kind' | 'type' | 'properties'>>
|
|
25
|
-
& {
|
|
26
|
-
properties?: ApiSchemaProperty[];
|
|
27
|
-
};
|
|
28
|
-
export type TestCombinedSchema = TestSchema & Partial<Omit<ApiSchemaExtensions<'combined'>, 'kind'>>;
|
|
29
|
-
export type TestUnknownSchema = TestSchema & Partial<Omit<ApiSchemaExtensions<'unknown'>, 'kind'>>;
|
|
30
|
-
|
|
31
|
-
let nextId = 0;
|
|
32
|
-
|
|
33
|
-
function createSchemaBase<T extends TestSchema>(schema: T) {
|
|
34
|
-
const name = schema.name ?? `schema-${nextId++}`;
|
|
35
|
-
return {
|
|
36
|
-
...schema,
|
|
37
|
-
name,
|
|
38
|
-
$src: schema.$src,
|
|
39
|
-
id: schema.id ?? name,
|
|
40
|
-
isNameGenerated: schema.isNameGenerated ?? schema.id !== undefined,
|
|
41
|
-
deprecated: schema.deprecated ?? false,
|
|
42
|
-
accessibility: schema.accessibility ?? 'all',
|
|
43
|
-
required: new Set(schema.required ?? []),
|
|
44
|
-
custom: {},
|
|
45
|
-
} as ApiSchemaBase & Omit<T, keyof ApiSchemaBase>;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export function createOneOfSchema(schema: TestOneofSchema = {}) {
|
|
49
|
-
return {
|
|
50
|
-
...createSchemaBase(schema),
|
|
51
|
-
kind: 'oneOf',
|
|
52
|
-
oneOf: schema.oneOf ?? [],
|
|
53
|
-
} as ApiSchema<'oneOf'>;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export function createMultiTypeSchema(schema: TestMultiTypeSchema = {}) {
|
|
57
|
-
return {
|
|
58
|
-
...createSchemaBase(schema),
|
|
59
|
-
kind: 'multi-type',
|
|
60
|
-
type: schema.type ?? [],
|
|
61
|
-
properties: new Map<string, ApiSchemaProperty>((schema.properties ?? []).map((p) => [p.name, p])),
|
|
62
|
-
allOf: schema.allOf ?? [],
|
|
63
|
-
anyOf: schema.anyOf ?? [],
|
|
64
|
-
} as ApiSchema<'multi-type'>;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export function createStringSchema(schema: TestStringSchema = {}) {
|
|
68
|
-
return {
|
|
69
|
-
...createSchemaBase(schema),
|
|
70
|
-
kind: 'string',
|
|
71
|
-
type: 'string',
|
|
72
|
-
} as ApiSchema<'string'>;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export function createBooleanSchema(schema: TestBooleanSchema = {}) {
|
|
76
|
-
return {
|
|
77
|
-
...createSchemaBase(schema),
|
|
78
|
-
kind: 'boolean',
|
|
79
|
-
type: 'boolean',
|
|
80
|
-
} as ApiSchema<'boolean'>;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export function createNullSchema(schema: TestNullSchema = {}) {
|
|
84
|
-
return {
|
|
85
|
-
...createSchemaBase(schema),
|
|
86
|
-
kind: 'null',
|
|
87
|
-
type: 'null',
|
|
88
|
-
} as ApiSchema<'null'>;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export function createNumberSchema(schema: TestNumberSchema = {}) {
|
|
92
|
-
return {
|
|
93
|
-
...createSchemaBase(schema),
|
|
94
|
-
kind: 'number',
|
|
95
|
-
type: 'number',
|
|
96
|
-
} as ApiSchema<'number'>;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
export function createIntegerSchema(schema: TestIntegerSchema = {}) {
|
|
100
|
-
return {
|
|
101
|
-
...createSchemaBase(schema),
|
|
102
|
-
kind: 'integer',
|
|
103
|
-
type: 'integer',
|
|
104
|
-
} as ApiSchema<'integer'>;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
export function createArraySchema(schema: TestArraySchema = {}) {
|
|
108
|
-
return {
|
|
109
|
-
...createSchemaBase(schema),
|
|
110
|
-
kind: 'array',
|
|
111
|
-
type: 'array',
|
|
112
|
-
items: schema.items ?? undefined,
|
|
113
|
-
} as ApiSchema<'array'>;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
export function createObjectSchema(schema: TestObjectSchema = {}) {
|
|
117
|
-
return {
|
|
118
|
-
...createSchemaBase(schema),
|
|
119
|
-
kind: 'object',
|
|
120
|
-
type: 'object',
|
|
121
|
-
properties: new Map<string, ApiSchemaProperty>((schema.properties ?? []).map((p) => [p.name, p])),
|
|
122
|
-
allOf: schema.allOf ?? [],
|
|
123
|
-
anyOf: schema.anyOf ?? [],
|
|
124
|
-
} as ApiSchema<'object'>;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
export function createCombinedSchema(schema: TestCombinedSchema = {}) {
|
|
128
|
-
return {
|
|
129
|
-
...createSchemaBase(schema),
|
|
130
|
-
kind: 'combined',
|
|
131
|
-
allOf: schema.allOf ?? [],
|
|
132
|
-
anyOf: schema.anyOf ?? [],
|
|
133
|
-
} as ApiSchema<'combined'>;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
export function createUnknownSchema(schema: TestUnknownSchema = {}) {
|
|
137
|
-
return {
|
|
138
|
-
...createSchemaBase(schema),
|
|
139
|
-
kind: 'unknown',
|
|
140
|
-
} as ApiSchema<'unknown'>;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
export function createOneOfProperty(name: string, schema: TestOneofSchema = {}): ApiSchemaProperty {
|
|
144
|
-
return { name, schema: createOneOfSchema(schema) };
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
export function createMultiTypeProperty(name: string, schema: TestMultiTypeSchema = {}): ApiSchemaProperty {
|
|
148
|
-
return { name, schema: createMultiTypeSchema(schema) };
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
export function createStringProperty(name: string, schema: TestStringSchema = {}): ApiSchemaProperty {
|
|
152
|
-
return { name, schema: createStringSchema(schema) };
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
export function createBooleanProperty(name: string, schema: TestBooleanSchema = {}): ApiSchemaProperty {
|
|
156
|
-
return { name, schema: createBooleanSchema(schema) };
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
export function createNullProperty(name: string, schema: TestNullSchema = {}): ApiSchemaProperty {
|
|
160
|
-
return { name, schema: createNullSchema(schema) };
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
export function createNumberProperty(name: string, schema: TestNumberSchema = {}): ApiSchemaProperty {
|
|
164
|
-
return { name, schema: createNumberSchema(schema) };
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
export function createIntegerProperty(name: string, schema: TestIntegerSchema = {}): ApiSchemaProperty {
|
|
168
|
-
return { name, schema: createIntegerSchema(schema) };
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
export function createArrayProperty(name: string, schema: TestArraySchema = {}): ApiSchemaProperty {
|
|
172
|
-
return { name, schema: createArraySchema(schema) };
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
export function createObjectProperty(name: string, schema: TestObjectSchema = {}): ApiSchemaProperty {
|
|
176
|
-
return { name, schema: createObjectSchema(schema) };
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
export function createCombinedProperty(name: string, schema: TestCombinedSchema = {}): ApiSchemaProperty {
|
|
180
|
-
return { name, schema: createCombinedSchema(schema) };
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
export function createUnknownProperty(name: string, schema: TestUnknownSchema = {}): ApiSchemaProperty {
|
|
184
|
-
return { name, schema: createUnknownSchema(schema) };
|
|
185
|
-
}
|
package/test_runner.js
DELETED
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
const pc = require("picocolors");
|
|
2
|
-
const process = require("process");
|
|
3
|
-
const { pathToFileURL } = require("url");
|
|
4
|
-
const { testDefinitions } = require("@deno/shim-deno-test");
|
|
5
|
-
const filePaths = [
|
|
6
|
-
"src/collect/helpers.test.js",
|
|
7
|
-
"src/transform/helpers.test.js",
|
|
8
|
-
"src/utils/action-provider.test.js",
|
|
9
|
-
"src/utils/common.utils.test.js",
|
|
10
|
-
"src/utils/condition.test.js",
|
|
11
|
-
"src/utils/endpoint.utils.test.js",
|
|
12
|
-
"src/utils/factory.test.js",
|
|
13
|
-
"src/utils/generator.utils.test.js",
|
|
14
|
-
"src/utils/object.utils.test.js",
|
|
15
|
-
"src/utils/schema.utils.test.js",
|
|
16
|
-
"src/utils/source-builder.test.js",
|
|
17
|
-
"src/utils/string-builder/string-builder.test.js",
|
|
18
|
-
"src/utils/string.utils.test.js",
|
|
19
|
-
"tests/openapi.test.js",
|
|
20
|
-
];
|
|
21
|
-
async function main() {
|
|
22
|
-
const testContext = {
|
|
23
|
-
process,
|
|
24
|
-
pc,
|
|
25
|
-
};
|
|
26
|
-
for (const [i, filePath] of filePaths.entries()) {
|
|
27
|
-
if (i > 0) {
|
|
28
|
-
console.log("");
|
|
29
|
-
}
|
|
30
|
-
const scriptPath = "./script/" + filePath;
|
|
31
|
-
console.log("Running tests in " + pc.underline(scriptPath) + "...\n");
|
|
32
|
-
process.chdir(__dirname + "/script");
|
|
33
|
-
const scriptTestContext = {
|
|
34
|
-
origin: pathToFileURL(filePath).toString(),
|
|
35
|
-
...testContext,
|
|
36
|
-
};
|
|
37
|
-
try {
|
|
38
|
-
require(scriptPath);
|
|
39
|
-
}
|
|
40
|
-
catch (err) {
|
|
41
|
-
console.error(err);
|
|
42
|
-
process.exit(1);
|
|
43
|
-
}
|
|
44
|
-
await runTestDefinitions(testDefinitions.splice(0, testDefinitions.length), scriptTestContext);
|
|
45
|
-
const esmPath = "./esm/" + filePath;
|
|
46
|
-
console.log("\nRunning tests in " + pc.underline(esmPath) + "...\n");
|
|
47
|
-
process.chdir(__dirname + "/esm");
|
|
48
|
-
const esmTestContext = {
|
|
49
|
-
origin: pathToFileURL(filePath).toString(),
|
|
50
|
-
...testContext,
|
|
51
|
-
};
|
|
52
|
-
await import(esmPath);
|
|
53
|
-
await runTestDefinitions(testDefinitions.splice(0, testDefinitions.length), esmTestContext);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
async function runTestDefinitions(testDefinitions, options) {
|
|
57
|
-
var _a, _b;
|
|
58
|
-
const testFailures = [];
|
|
59
|
-
const hasOnly = testDefinitions.some((d) => d.only);
|
|
60
|
-
if (hasOnly) {
|
|
61
|
-
testDefinitions = testDefinitions.filter((d) => d.only);
|
|
62
|
-
}
|
|
63
|
-
for (const definition of testDefinitions) {
|
|
64
|
-
options.process.stdout.write("test " + definition.name + " ...");
|
|
65
|
-
if (definition.ignore) {
|
|
66
|
-
options.process.stdout.write(` ${options.pc.gray("ignored")}\n`);
|
|
67
|
-
continue;
|
|
68
|
-
}
|
|
69
|
-
const context = getTestContext(definition, undefined);
|
|
70
|
-
let pass = false;
|
|
71
|
-
try {
|
|
72
|
-
await definition.fn(context);
|
|
73
|
-
if (context.hasFailingChild) {
|
|
74
|
-
testFailures.push({
|
|
75
|
-
name: definition.name,
|
|
76
|
-
err: new Error("Had failing test step.")
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
else {
|
|
80
|
-
pass = true;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
catch (err) {
|
|
84
|
-
testFailures.push({
|
|
85
|
-
name: definition.name,
|
|
86
|
-
err
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
const testStepOutput = context.getOutput();
|
|
90
|
-
if (testStepOutput.length > 0) {
|
|
91
|
-
options.process.stdout.write(testStepOutput);
|
|
92
|
-
}
|
|
93
|
-
else {
|
|
94
|
-
options.process.stdout.write(" ");
|
|
95
|
-
}
|
|
96
|
-
options.process.stdout.write(getStatusText(pass ? "ok" : "fail"));
|
|
97
|
-
options.process.stdout.write("\n");
|
|
98
|
-
}
|
|
99
|
-
if (testFailures.length > 0) {
|
|
100
|
-
options.process.stdout.write("\nFAILURES");
|
|
101
|
-
for (const failure of testFailures) {
|
|
102
|
-
options.process.stdout.write("\n\n");
|
|
103
|
-
options.process.stdout.write(failure.name + "\n");
|
|
104
|
-
options.process.stdout.write(indentText(((_b = (_a = failure.err) === null || _a === void 0 ? void 0 : _a.stack) !== null && _b !== void 0 ? _b : failure.err).toString(), 1));
|
|
105
|
-
}
|
|
106
|
-
options.process.exit(1);
|
|
107
|
-
}
|
|
108
|
-
else if (hasOnly) {
|
|
109
|
-
options.process.stdout.write('error: Test failed because the "only" option was used.\n');
|
|
110
|
-
options.process.exit(1);
|
|
111
|
-
}
|
|
112
|
-
function getTestContext(definition, parent) {
|
|
113
|
-
return {
|
|
114
|
-
name: definition.name,
|
|
115
|
-
parent,
|
|
116
|
-
origin: options.origin,
|
|
117
|
-
/** @type {any} */ err: undefined,
|
|
118
|
-
status: "ok",
|
|
119
|
-
children: [],
|
|
120
|
-
get hasFailingChild() {
|
|
121
|
-
return this.children.some((c) => c.status === "fail" || c.status === "pending");
|
|
122
|
-
},
|
|
123
|
-
getOutput() {
|
|
124
|
-
var _a;
|
|
125
|
-
let output = "";
|
|
126
|
-
if (this.parent) {
|
|
127
|
-
output += "test " + this.name + " ...";
|
|
128
|
-
}
|
|
129
|
-
if (this.children.length > 0) {
|
|
130
|
-
output += "\n" + this.children.map((c) => indentText(c.getOutput(), 1)).join("\n") + "\n";
|
|
131
|
-
}
|
|
132
|
-
else if (!this.err) {
|
|
133
|
-
output += " ";
|
|
134
|
-
}
|
|
135
|
-
if (this.parent && this.err) {
|
|
136
|
-
output += "\n";
|
|
137
|
-
}
|
|
138
|
-
if (this.err) {
|
|
139
|
-
output += indentText(((_a = this.err.stack) !== null && _a !== void 0 ? _a : this.err).toString(), 1);
|
|
140
|
-
if (this.parent) {
|
|
141
|
-
output += "\n";
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
if (this.parent) {
|
|
145
|
-
output += getStatusText(this.status);
|
|
146
|
-
}
|
|
147
|
-
return output;
|
|
148
|
-
},
|
|
149
|
-
async step(nameOrTestDefinition, fn) {
|
|
150
|
-
const definition = getDefinition();
|
|
151
|
-
const context = getTestContext(definition, this);
|
|
152
|
-
context.status = "pending";
|
|
153
|
-
this.children.push(context);
|
|
154
|
-
if (definition.ignore) {
|
|
155
|
-
context.status = "ignored";
|
|
156
|
-
return false;
|
|
157
|
-
}
|
|
158
|
-
try {
|
|
159
|
-
await definition.fn(context);
|
|
160
|
-
context.status = "ok";
|
|
161
|
-
if (context.hasFailingChild) {
|
|
162
|
-
context.status = "fail";
|
|
163
|
-
return false;
|
|
164
|
-
}
|
|
165
|
-
return true;
|
|
166
|
-
}
|
|
167
|
-
catch (err) {
|
|
168
|
-
context.status = "fail";
|
|
169
|
-
context.err = err;
|
|
170
|
-
return false;
|
|
171
|
-
}
|
|
172
|
-
/** @returns {TestDefinition} */ function getDefinition() {
|
|
173
|
-
if (typeof nameOrTestDefinition === "string") {
|
|
174
|
-
if (!(fn instanceof Function)) {
|
|
175
|
-
throw new TypeError("Expected function for second argument.");
|
|
176
|
-
}
|
|
177
|
-
return {
|
|
178
|
-
name: nameOrTestDefinition,
|
|
179
|
-
fn
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
else if (typeof nameOrTestDefinition === "object") {
|
|
183
|
-
return nameOrTestDefinition;
|
|
184
|
-
}
|
|
185
|
-
else {
|
|
186
|
-
throw new TypeError("Expected a test definition or name and function.");
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
|
-
function getStatusText(status) {
|
|
193
|
-
switch (status) {
|
|
194
|
-
case "ok":
|
|
195
|
-
return options.pc.green(status);
|
|
196
|
-
case "fail":
|
|
197
|
-
case "pending":
|
|
198
|
-
return options.pc.red(status);
|
|
199
|
-
case "ignored":
|
|
200
|
-
return options.pc.gray(status);
|
|
201
|
-
default:
|
|
202
|
-
{
|
|
203
|
-
const _assertNever = status;
|
|
204
|
-
return status;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
function indentText(text, indentLevel) {
|
|
209
|
-
if (text === undefined) {
|
|
210
|
-
text = "[undefined]";
|
|
211
|
-
}
|
|
212
|
-
else if (text === null) {
|
|
213
|
-
text = "[null]";
|
|
214
|
-
}
|
|
215
|
-
else {
|
|
216
|
-
text = text.toString();
|
|
217
|
-
}
|
|
218
|
-
return text.split(/\r?\n/).map((line) => " ".repeat(indentLevel) + line).join("\n");
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
main();
|