@goast/kotlin 0.4.2-beta1 → 0.4.2
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/README.md +45 -45
- package/assets/client/okhttp3/ApiClient.kt +250 -250
- package/esm/_dnt.test_polyfills.d.ts +29 -0
- package/esm/_dnt.test_polyfills.d.ts.map +1 -0
- package/esm/_dnt.test_polyfills.js +31 -0
- package/esm/_dnt.test_shims.d.ts +6 -0
- package/esm/_dnt.test_shims.d.ts.map +1 -0
- package/esm/_dnt.test_shims.js +61 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/assertion_error.d.ts +26 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/assertion_error.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/assertion_error.js +30 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/equal.d.ts +17 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/equal.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/equal.js +136 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/equals.d.ts +22 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/equals.js +45 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/false.d.ts +18 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/false.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/false.js +22 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/instance_of.d.ts +23 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/instance_of.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/instance_of.js +53 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/is_error.d.ts +25 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/is_error.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/is_error.js +54 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/match.d.ts +18 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/match.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/match.js +26 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/not_instance_of.d.ts +20 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/not_instance_of.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/not_instance_of.js +29 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/not_match.d.ts +18 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/not_match.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/not_match.js +26 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/not_strict_equals.d.ts +23 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/not_strict_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/not_strict_equals.js +32 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/object_match.d.ts +28 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/object_match.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/object_match.js +159 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/rejects.d.ts +42 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/rejects.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/rejects.js +53 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/strict_equals.d.ts +24 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/strict_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/strict_equals.js +57 -0
- package/esm/deps/jsr.io/@std/expect/1.0.6/_assert_equals.d.ts +20 -0
- package/esm/deps/jsr.io/@std/expect/1.0.6/_assert_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.6/_assert_equals.js +29 -0
- package/esm/deps/jsr.io/@std/expect/1.0.6/_assert_not_equals.d.ts +17 -0
- package/esm/deps/jsr.io/@std/expect/1.0.6/_assert_not_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.6/_assert_not_equals.js +26 -0
- package/esm/deps/jsr.io/@std/expect/1.0.6/_assertion.d.ts +3 -0
- package/esm/deps/jsr.io/@std/expect/1.0.6/_assertion.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.6/_assertion.js +9 -0
- package/esm/deps/jsr.io/@std/expect/1.0.6/_asymmetric_matchers.d.ts +41 -0
- package/esm/deps/jsr.io/@std/expect/1.0.6/_asymmetric_matchers.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.6/_asymmetric_matchers.js +143 -0
- package/esm/deps/jsr.io/@std/expect/1.0.6/_build_message.d.ts +6 -0
- package/esm/deps/jsr.io/@std/expect/1.0.6/_build_message.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.6/_build_message.js +29 -0
- package/esm/deps/jsr.io/@std/expect/1.0.6/_custom_equality_tester.d.ts +4 -0
- package/esm/deps/jsr.io/@std/expect/1.0.6/_custom_equality_tester.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.6/_custom_equality_tester.js +11 -0
- package/esm/deps/jsr.io/@std/expect/1.0.6/_equal.d.ts +9 -0
- package/esm/deps/jsr.io/@std/expect/1.0.6/_equal.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.6/_equal.js +191 -0
- package/esm/deps/jsr.io/@std/expect/1.0.6/_extend.d.ts +4 -0
- package/esm/deps/jsr.io/@std/expect/1.0.6/_extend.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.6/_extend.js +11 -0
- package/esm/deps/jsr.io/@std/expect/1.0.6/_inspect_args.d.ts +3 -0
- package/esm/deps/jsr.io/@std/expect/1.0.6/_inspect_args.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.6/_inspect_args.js +12 -0
- package/esm/deps/jsr.io/@std/expect/1.0.6/_matchers.d.ts +34 -0
- package/esm/deps/jsr.io/@std/expect/1.0.6/_matchers.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.6/_matchers.js +564 -0
- package/esm/deps/jsr.io/@std/expect/1.0.6/_mock_util.d.ts +11 -0
- package/esm/deps/jsr.io/@std/expect/1.0.6/_mock_util.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.6/_mock_util.js +10 -0
- package/esm/deps/jsr.io/@std/expect/1.0.6/_types.d.ts +838 -0
- package/esm/deps/jsr.io/@std/expect/1.0.6/_types.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.6/_types.js +3 -0
- package/esm/deps/jsr.io/@std/expect/1.0.6/_utils.d.ts +8 -0
- package/esm/deps/jsr.io/@std/expect/1.0.6/_utils.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.6/_utils.js +159 -0
- package/esm/deps/jsr.io/@std/expect/1.0.6/expect.d.ts +52 -0
- package/esm/deps/jsr.io/@std/expect/1.0.6/expect.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.6/expect.js +441 -0
- package/esm/deps/jsr.io/@std/internal/1.0.4/assertion_state.d.ts +75 -0
- package/esm/deps/jsr.io/@std/internal/1.0.4/assertion_state.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.4/assertion_state.js +101 -0
- package/esm/deps/jsr.io/@std/internal/1.0.4/build_message.d.ts +82 -0
- package/esm/deps/jsr.io/@std/internal/1.0.4/build_message.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.4/build_message.js +111 -0
- package/esm/deps/jsr.io/@std/internal/1.0.4/diff.d.ts +140 -0
- package/esm/deps/jsr.io/@std/internal/1.0.4/diff.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.4/diff.js +277 -0
- package/esm/deps/jsr.io/@std/internal/1.0.4/diff_str.d.ts +99 -0
- package/esm/deps/jsr.io/@std/internal/1.0.4/diff_str.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.4/diff_str.js +180 -0
- package/esm/deps/jsr.io/@std/internal/1.0.4/format.d.ts +2 -0
- package/esm/deps/jsr.io/@std/internal/1.0.4/format.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.4/format.js +37 -0
- package/esm/deps/jsr.io/@std/internal/1.0.4/styles.d.ts +159 -0
- package/esm/deps/jsr.io/@std/internal/1.0.4/styles.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.4/styles.js +207 -0
- package/esm/deps/jsr.io/@std/internal/1.0.4/types.d.ts +16 -0
- package/esm/deps/jsr.io/@std/internal/1.0.4/types.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.4/types.js +2 -0
- package/esm/deps/jsr.io/@std/testing/1.0.3/_test_suite.d.ts +74 -0
- package/esm/deps/jsr.io/@std/testing/1.0.3/_test_suite.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/testing/1.0.3/_test_suite.js +340 -0
- package/esm/deps/jsr.io/@std/testing/1.0.3/bdd.d.ts +731 -0
- package/esm/deps/jsr.io/@std/testing/1.0.3/bdd.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/testing/1.0.3/bdd.js +576 -0
- package/esm/deps/jsr.io/@std/testing/1.0.3/mock.d.ts +674 -0
- package/esm/deps/jsr.io/@std/testing/1.0.3/mock.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/testing/1.0.3/mock.js +1117 -0
- package/esm/src/ast/nodes/annotation.test.d.ts +2 -0
- package/esm/src/ast/nodes/annotation.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/annotation.test.js +56 -0
- package/esm/src/ast/nodes/argument.test.d.ts +2 -0
- package/esm/src/ast/nodes/argument.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/argument.test.js +33 -0
- package/esm/src/ast/nodes/call.test.d.ts +2 -0
- package/esm/src/ast/nodes/call.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/call.test.js +35 -0
- package/esm/src/ast/nodes/class.test.d.ts +2 -0
- package/esm/src/ast/nodes/class.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/class.test.js +219 -0
- package/esm/src/ast/nodes/constructor.test.d.ts +2 -0
- package/esm/src/ast/nodes/constructor.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/constructor.test.js +139 -0
- package/esm/src/ast/nodes/doc-tag.test.d.ts +2 -0
- package/esm/src/ast/nodes/doc-tag.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/doc-tag.test.js +67 -0
- package/esm/src/ast/nodes/doc.test.d.ts +2 -0
- package/esm/src/ast/nodes/doc.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/doc.test.js +33 -0
- package/esm/src/ast/nodes/enum-value.test.d.ts +2 -0
- package/esm/src/ast/nodes/enum-value.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/enum-value.test.js +115 -0
- package/esm/src/ast/nodes/enum.test.d.ts +2 -0
- package/esm/src/ast/nodes/enum.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/enum.test.js +129 -0
- package/esm/src/ast/nodes/function.test.d.ts +2 -0
- package/esm/src/ast/nodes/function.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/function.test.js +160 -0
- package/esm/src/ast/nodes/generic-parameter.test.d.ts +2 -0
- package/esm/src/ast/nodes/generic-parameter.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/generic-parameter.test.js +49 -0
- package/esm/src/ast/nodes/init-block.test.d.ts +2 -0
- package/esm/src/ast/nodes/init-block.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/init-block.test.js +28 -0
- package/esm/src/ast/nodes/interface.test.d.ts +2 -0
- package/esm/src/ast/nodes/interface.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/interface.test.js +121 -0
- package/esm/src/ast/nodes/object.test.d.ts +2 -0
- package/esm/src/ast/nodes/object.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/object.test.js +78 -0
- package/esm/src/ast/nodes/parameter.test.d.ts +2 -0
- package/esm/src/ast/nodes/parameter.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/parameter.test.js +152 -0
- package/esm/src/ast/nodes/property.test.d.ts +2 -0
- package/esm/src/ast/nodes/property.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/property.test.js +206 -0
- package/esm/src/ast/nodes/reference.test.d.ts +2 -0
- package/esm/src/ast/nodes/reference.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/reference.test.js +36 -0
- package/esm/src/ast/nodes/string.test.d.ts +2 -0
- package/esm/src/ast/nodes/string.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/string.test.js +48 -0
- package/esm/src/generators/services/okhttp3-clients/okhttp3-client-generator.js +26 -26
- package/esm/src/import-collection.test.d.ts +2 -0
- package/esm/src/import-collection.test.d.ts.map +1 -0
- package/esm/src/import-collection.test.js +99 -0
- package/esm/tests/openapi-models.test.d.ts +2 -0
- package/esm/tests/openapi-models.test.d.ts.map +1 -0
- package/esm/tests/openapi-models.test.js +45 -0
- package/package.json +2 -2
- package/script/_dnt.test_polyfills.d.ts +29 -0
- package/script/_dnt.test_polyfills.d.ts.map +1 -0
- package/script/_dnt.test_polyfills.js +32 -0
- package/script/_dnt.test_shims.d.ts +6 -0
- package/script/_dnt.test_shims.d.ts.map +1 -0
- package/script/_dnt.test_shims.js +65 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/assertion_error.d.ts +26 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/assertion_error.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/assertion_error.js +34 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/equal.d.ts +17 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/equal.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/equal.js +139 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/equals.d.ts +22 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/equals.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/equals.js +48 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/false.d.ts +18 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/false.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/false.js +25 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/instance_of.d.ts +23 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/instance_of.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/instance_of.js +56 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/is_error.d.ts +25 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/is_error.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/is_error.js +57 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/match.d.ts +18 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/match.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/match.js +29 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/not_instance_of.d.ts +20 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/not_instance_of.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/not_instance_of.js +32 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/not_match.d.ts +18 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/not_match.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/not_match.js +29 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/not_strict_equals.d.ts +23 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/not_strict_equals.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/not_strict_equals.js +35 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/object_match.d.ts +28 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/object_match.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/object_match.js +162 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/rejects.d.ts +42 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/rejects.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/rejects.js +56 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/strict_equals.d.ts +24 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/strict_equals.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/strict_equals.js +60 -0
- package/script/deps/jsr.io/@std/expect/1.0.6/_assert_equals.d.ts +20 -0
- package/script/deps/jsr.io/@std/expect/1.0.6/_assert_equals.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.6/_assert_equals.js +32 -0
- package/script/deps/jsr.io/@std/expect/1.0.6/_assert_not_equals.d.ts +17 -0
- package/script/deps/jsr.io/@std/expect/1.0.6/_assert_not_equals.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.6/_assert_not_equals.js +29 -0
- package/script/deps/jsr.io/@std/expect/1.0.6/_assertion.d.ts +3 -0
- package/script/deps/jsr.io/@std/expect/1.0.6/_assertion.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.6/_assertion.js +13 -0
- package/script/deps/jsr.io/@std/expect/1.0.6/_asymmetric_matchers.d.ts +41 -0
- package/script/deps/jsr.io/@std/expect/1.0.6/_asymmetric_matchers.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.6/_asymmetric_matchers.js +161 -0
- package/script/deps/jsr.io/@std/expect/1.0.6/_build_message.d.ts +6 -0
- package/script/deps/jsr.io/@std/expect/1.0.6/_build_message.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.6/_build_message.js +33 -0
- package/script/deps/jsr.io/@std/expect/1.0.6/_custom_equality_tester.d.ts +4 -0
- package/script/deps/jsr.io/@std/expect/1.0.6/_custom_equality_tester.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.6/_custom_equality_tester.js +15 -0
- package/script/deps/jsr.io/@std/expect/1.0.6/_equal.d.ts +9 -0
- package/script/deps/jsr.io/@std/expect/1.0.6/_equal.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.6/_equal.js +194 -0
- package/script/deps/jsr.io/@std/expect/1.0.6/_extend.d.ts +4 -0
- package/script/deps/jsr.io/@std/expect/1.0.6/_extend.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.6/_extend.js +15 -0
- package/script/deps/jsr.io/@std/expect/1.0.6/_inspect_args.d.ts +3 -0
- package/script/deps/jsr.io/@std/expect/1.0.6/_inspect_args.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.6/_inspect_args.js +17 -0
- package/script/deps/jsr.io/@std/expect/1.0.6/_matchers.d.ts +34 -0
- package/script/deps/jsr.io/@std/expect/1.0.6/_matchers.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.6/_matchers.js +598 -0
- package/script/deps/jsr.io/@std/expect/1.0.6/_mock_util.d.ts +11 -0
- package/script/deps/jsr.io/@std/expect/1.0.6/_mock_util.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.6/_mock_util.js +14 -0
- package/script/deps/jsr.io/@std/expect/1.0.6/_types.d.ts +838 -0
- package/script/deps/jsr.io/@std/expect/1.0.6/_types.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.6/_types.js +4 -0
- package/script/deps/jsr.io/@std/expect/1.0.6/_utils.d.ts +8 -0
- package/script/deps/jsr.io/@std/expect/1.0.6/_utils.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.6/_utils.js +166 -0
- package/script/deps/jsr.io/@std/expect/1.0.6/expect.d.ts +52 -0
- package/script/deps/jsr.io/@std/expect/1.0.6/expect.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.6/expect.js +445 -0
- package/script/deps/jsr.io/@std/internal/1.0.4/assertion_state.d.ts +75 -0
- package/script/deps/jsr.io/@std/internal/1.0.4/assertion_state.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.4/assertion_state.js +106 -0
- package/script/deps/jsr.io/@std/internal/1.0.4/build_message.d.ts +82 -0
- package/script/deps/jsr.io/@std/internal/1.0.4/build_message.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.4/build_message.js +116 -0
- package/script/deps/jsr.io/@std/internal/1.0.4/diff.d.ts +140 -0
- package/script/deps/jsr.io/@std/internal/1.0.4/diff.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.4/diff.js +284 -0
- package/script/deps/jsr.io/@std/internal/1.0.4/diff_str.d.ts +99 -0
- package/script/deps/jsr.io/@std/internal/1.0.4/diff_str.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.4/diff_str.js +186 -0
- package/script/deps/jsr.io/@std/internal/1.0.4/format.d.ts +2 -0
- package/script/deps/jsr.io/@std/internal/1.0.4/format.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.4/format.js +41 -0
- package/script/deps/jsr.io/@std/internal/1.0.4/styles.d.ts +159 -0
- package/script/deps/jsr.io/@std/internal/1.0.4/styles.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.4/styles.js +220 -0
- package/script/deps/jsr.io/@std/internal/1.0.4/types.d.ts +16 -0
- package/script/deps/jsr.io/@std/internal/1.0.4/types.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.4/types.js +3 -0
- package/script/deps/jsr.io/@std/testing/1.0.3/_test_suite.d.ts +74 -0
- package/script/deps/jsr.io/@std/testing/1.0.3/_test_suite.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/testing/1.0.3/_test_suite.js +345 -0
- package/script/deps/jsr.io/@std/testing/1.0.3/bdd.d.ts +731 -0
- package/script/deps/jsr.io/@std/testing/1.0.3/bdd.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/testing/1.0.3/bdd.js +587 -0
- package/script/deps/jsr.io/@std/testing/1.0.3/mock.d.ts +674 -0
- package/script/deps/jsr.io/@std/testing/1.0.3/mock.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/testing/1.0.3/mock.js +1136 -0
- package/script/src/ast/nodes/annotation.test.d.ts +2 -0
- package/script/src/ast/nodes/annotation.test.d.ts.map +1 -0
- package/script/src/ast/nodes/annotation.test.js +58 -0
- package/script/src/ast/nodes/argument.test.d.ts +2 -0
- package/script/src/ast/nodes/argument.test.d.ts.map +1 -0
- package/script/src/ast/nodes/argument.test.js +35 -0
- package/script/src/ast/nodes/call.test.d.ts +2 -0
- package/script/src/ast/nodes/call.test.d.ts.map +1 -0
- package/script/src/ast/nodes/call.test.js +37 -0
- package/script/src/ast/nodes/class.test.d.ts +2 -0
- package/script/src/ast/nodes/class.test.d.ts.map +1 -0
- package/script/src/ast/nodes/class.test.js +221 -0
- package/script/src/ast/nodes/constructor.test.d.ts +2 -0
- package/script/src/ast/nodes/constructor.test.d.ts.map +1 -0
- package/script/src/ast/nodes/constructor.test.js +141 -0
- package/script/src/ast/nodes/doc-tag.test.d.ts +2 -0
- package/script/src/ast/nodes/doc-tag.test.d.ts.map +1 -0
- package/script/src/ast/nodes/doc-tag.test.js +69 -0
- package/script/src/ast/nodes/doc.test.d.ts +2 -0
- package/script/src/ast/nodes/doc.test.d.ts.map +1 -0
- package/script/src/ast/nodes/doc.test.js +35 -0
- package/script/src/ast/nodes/enum-value.test.d.ts +2 -0
- package/script/src/ast/nodes/enum-value.test.d.ts.map +1 -0
- package/script/src/ast/nodes/enum-value.test.js +117 -0
- package/script/src/ast/nodes/enum.test.d.ts +2 -0
- package/script/src/ast/nodes/enum.test.d.ts.map +1 -0
- package/script/src/ast/nodes/enum.test.js +131 -0
- package/script/src/ast/nodes/function.test.d.ts +2 -0
- package/script/src/ast/nodes/function.test.d.ts.map +1 -0
- package/script/src/ast/nodes/function.test.js +162 -0
- package/script/src/ast/nodes/generic-parameter.test.d.ts +2 -0
- package/script/src/ast/nodes/generic-parameter.test.d.ts.map +1 -0
- package/script/src/ast/nodes/generic-parameter.test.js +51 -0
- package/script/src/ast/nodes/init-block.test.d.ts +2 -0
- package/script/src/ast/nodes/init-block.test.d.ts.map +1 -0
- package/script/src/ast/nodes/init-block.test.js +30 -0
- package/script/src/ast/nodes/interface.test.d.ts +2 -0
- package/script/src/ast/nodes/interface.test.d.ts.map +1 -0
- package/script/src/ast/nodes/interface.test.js +123 -0
- package/script/src/ast/nodes/object.test.d.ts +2 -0
- package/script/src/ast/nodes/object.test.d.ts.map +1 -0
- package/script/src/ast/nodes/object.test.js +80 -0
- package/script/src/ast/nodes/parameter.test.d.ts +2 -0
- package/script/src/ast/nodes/parameter.test.d.ts.map +1 -0
- package/script/src/ast/nodes/parameter.test.js +154 -0
- package/script/src/ast/nodes/property.test.d.ts +2 -0
- package/script/src/ast/nodes/property.test.d.ts.map +1 -0
- package/script/src/ast/nodes/property.test.js +208 -0
- package/script/src/ast/nodes/reference.test.d.ts +2 -0
- package/script/src/ast/nodes/reference.test.d.ts.map +1 -0
- package/script/src/ast/nodes/reference.test.js +38 -0
- package/script/src/ast/nodes/string.test.d.ts +2 -0
- package/script/src/ast/nodes/string.test.d.ts.map +1 -0
- package/script/src/ast/nodes/string.test.js +50 -0
- package/script/src/generators/services/okhttp3-clients/okhttp3-client-generator.js +26 -26
- package/script/src/import-collection.test.d.ts +2 -0
- package/script/src/import-collection.test.d.ts.map +1 -0
- package/script/src/import-collection.test.js +101 -0
- package/script/tests/openapi-models.test.d.ts +2 -0
- package/script/tests/openapi-models.test.d.ts.map +1 -0
- package/script/tests/openapi-models.test.js +48 -0
- package/src/_dnt.test_polyfills.ts +70 -0
- package/src/_dnt.test_shims.ts +64 -0
- package/src/deps/jsr.io/@std/assert/1.0.6/assertion_error.ts +31 -0
- package/src/deps/jsr.io/@std/assert/1.0.6/equal.ts +152 -0
- package/src/deps/jsr.io/@std/assert/1.0.6/equals.ts +52 -0
- package/src/deps/jsr.io/@std/assert/1.0.6/false.ts +26 -0
- package/src/deps/jsr.io/@std/assert/1.0.6/instance_of.ts +64 -0
- package/src/deps/jsr.io/@std/assert/1.0.6/is_error.ts +65 -0
- package/src/deps/jsr.io/@std/assert/1.0.6/match.ts +30 -0
- package/src/deps/jsr.io/@std/assert/1.0.6/not_instance_of.ts +33 -0
- package/src/deps/jsr.io/@std/assert/1.0.6/not_match.ts +30 -0
- package/src/deps/jsr.io/@std/assert/1.0.6/not_strict_equals.ts +42 -0
- package/src/deps/jsr.io/@std/assert/1.0.6/object_match.ts +202 -0
- package/src/deps/jsr.io/@std/assert/1.0.6/rejects.ts +123 -0
- package/src/deps/jsr.io/@std/assert/1.0.6/strict_equals.ts +67 -0
- package/src/deps/jsr.io/@std/expect/1.0.6/_assert_equals.ts +38 -0
- package/src/deps/jsr.io/@std/expect/1.0.6/_assert_not_equals.ts +35 -0
- package/src/deps/jsr.io/@std/expect/1.0.6/_assertion.ts +13 -0
- package/src/deps/jsr.io/@std/expect/1.0.6/_asymmetric_matchers.ts +177 -0
- package/src/deps/jsr.io/@std/expect/1.0.6/_build_message.ts +51 -0
- package/src/deps/jsr.io/@std/expect/1.0.6/_custom_equality_tester.ts +19 -0
- package/src/deps/jsr.io/@std/expect/1.0.6/_equal.ts +229 -0
- package/src/deps/jsr.io/@std/expect/1.0.6/_extend.ts +16 -0
- package/src/deps/jsr.io/@std/expect/1.0.6/_inspect_args.ts +15 -0
- package/src/deps/jsr.io/@std/expect/1.0.6/_matchers.ts +828 -0
- package/src/deps/jsr.io/@std/expect/1.0.6/_mock_util.ts +22 -0
- package/src/deps/jsr.io/@std/expect/1.0.6/_types.ts +917 -0
- package/src/deps/jsr.io/@std/expect/1.0.6/_utils.ts +201 -0
- package/src/deps/jsr.io/@std/expect/1.0.6/expect.ts +529 -0
- package/src/deps/jsr.io/@std/internal/1.0.4/assertion_state.ts +111 -0
- package/src/deps/jsr.io/@std/internal/1.0.4/build_message.ts +134 -0
- package/src/deps/jsr.io/@std/internal/1.0.4/diff.ts +317 -0
- package/src/deps/jsr.io/@std/internal/1.0.4/diff_str.ts +204 -0
- package/src/deps/jsr.io/@std/internal/1.0.4/format.ts +39 -0
- package/src/deps/jsr.io/@std/internal/1.0.4/styles.ts +233 -0
- package/src/deps/jsr.io/@std/internal/1.0.4/types.ts +18 -0
- package/src/deps/jsr.io/@std/testing/1.0.3/_test_suite.ts +389 -0
- package/src/deps/jsr.io/@std/testing/1.0.3/bdd.ts +1202 -0
- package/src/deps/jsr.io/@std/testing/1.0.3/mock.ts +1839 -0
- package/src/mod.ts +8 -0
- package/src/src/assets.ts +9 -0
- package/src/src/ast/_index.ts +66 -0
- package/src/src/ast/common.ts +1 -0
- package/src/src/ast/index.ts +1 -0
- package/src/src/ast/node.ts +10 -0
- package/src/src/ast/nodes/annotation.test.ts +69 -0
- package/src/src/ast/nodes/annotation.ts +79 -0
- package/src/src/ast/nodes/argument.test.ts +41 -0
- package/src/src/ast/nodes/argument.ts +62 -0
- package/src/src/ast/nodes/call.test.ts +44 -0
- package/src/src/ast/nodes/call.ts +66 -0
- package/src/src/ast/nodes/class.test.ts +274 -0
- package/src/src/ast/nodes/class.ts +178 -0
- package/src/src/ast/nodes/collection-literal.ts +49 -0
- package/src/src/ast/nodes/constructor.test.ts +178 -0
- package/src/src/ast/nodes/constructor.ts +126 -0
- package/src/src/ast/nodes/doc-tag.test.ts +84 -0
- package/src/src/ast/nodes/doc-tag.ts +138 -0
- package/src/src/ast/nodes/doc.test.ts +42 -0
- package/src/src/ast/nodes/doc.ts +111 -0
- package/src/src/ast/nodes/enum-value.test.ts +146 -0
- package/src/src/ast/nodes/enum-value.ts +100 -0
- package/src/src/ast/nodes/enum.test.ts +167 -0
- package/src/src/ast/nodes/enum.ts +163 -0
- package/src/src/ast/nodes/function.test.ts +194 -0
- package/src/src/ast/nodes/function.ts +176 -0
- package/src/src/ast/nodes/generic-parameter.test.ts +60 -0
- package/src/src/ast/nodes/generic-parameter.ts +54 -0
- package/src/src/ast/nodes/init-block.test.ts +36 -0
- package/src/src/ast/nodes/init-block.ts +38 -0
- package/src/src/ast/nodes/interface.test.ts +151 -0
- package/src/src/ast/nodes/interface.ts +133 -0
- package/src/src/ast/nodes/lambda-type.ts +68 -0
- package/src/src/ast/nodes/lambda.ts +68 -0
- package/src/src/ast/nodes/object.test.ts +101 -0
- package/src/src/ast/nodes/object.ts +102 -0
- package/src/src/ast/nodes/parameter.test.ts +191 -0
- package/src/src/ast/nodes/parameter.ts +118 -0
- package/src/src/ast/nodes/property.test.ts +253 -0
- package/src/src/ast/nodes/property.ts +225 -0
- package/src/src/ast/nodes/reference.test.ts +47 -0
- package/src/src/ast/nodes/reference.ts +178 -0
- package/src/src/ast/nodes/string.test.ts +61 -0
- package/src/src/ast/nodes/string.ts +114 -0
- package/src/src/ast/nodes/types.ts +23 -0
- package/src/src/ast/references/index.ts +8 -0
- package/src/src/ast/references/jackson.ts +16 -0
- package/src/src/ast/references/jakarta.ts +10 -0
- package/src/src/ast/references/java.ts +19 -0
- package/src/src/ast/references/kotlin.ts +40 -0
- package/src/src/ast/references/okhttp3.ts +5 -0
- package/src/src/ast/references/reactor.ts +5 -0
- package/src/src/ast/references/spring.ts +58 -0
- package/src/src/ast/references/swagger.ts +19 -0
- package/src/src/ast/utils/get-kotlin-builder-options.ts +19 -0
- package/src/src/ast/utils/to-kt-node.ts +31 -0
- package/src/src/ast/utils/write-kt-annotations.ts +15 -0
- package/src/src/ast/utils/write-kt-arguments.ts +45 -0
- package/src/src/ast/utils/write-kt-enum-values.ts +27 -0
- package/src/src/ast/utils/write-kt-generic-parameters.ts +12 -0
- package/src/src/ast/utils/write-kt-members.ts +25 -0
- package/src/src/ast/utils/write-kt-node.ts +37 -0
- package/src/src/ast/utils/write-kt-parameters.ts +25 -0
- package/src/src/common-results.ts +4 -0
- package/src/src/config.ts +39 -0
- package/src/src/file-builder.ts +108 -0
- package/src/src/generators/file-generator.ts +29 -0
- package/src/src/generators/index.ts +4 -0
- package/src/src/generators/models/args.ts +128 -0
- package/src/src/generators/models/index.ts +4 -0
- package/src/src/generators/models/model-generator.ts +602 -0
- package/src/src/generators/models/models-generator.ts +65 -0
- package/src/src/generators/models/models.ts +95 -0
- package/src/src/generators/services/okhttp3-clients/args.ts +78 -0
- package/src/src/generators/services/okhttp3-clients/index.ts +4 -0
- package/src/src/generators/services/okhttp3-clients/models.ts +60 -0
- package/src/src/generators/services/okhttp3-clients/okhttp3-client-generator.ts +557 -0
- package/src/src/generators/services/okhttp3-clients/okhttp3-clients-generator.ts +128 -0
- package/src/src/generators/services/okhttp3-clients/refs.ts +55 -0
- package/src/src/generators/services/spring-controllers/args.ts +71 -0
- package/src/src/generators/services/spring-controllers/index.ts +4 -0
- package/src/src/generators/services/spring-controllers/models.ts +58 -0
- package/src/src/generators/services/spring-controllers/spring-controller-generator.ts +605 -0
- package/src/src/generators/services/spring-controllers/spring-controllers-generator.ts +70 -0
- package/src/src/import-collection.test.ts +116 -0
- package/src/src/import-collection.ts +98 -0
- package/src/src/types.ts +3 -0
- package/src/src/utils.ts +39 -0
- package/src/tests/openapi-models.test.ts +63 -0
- package/test_runner.js +227 -0
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
3
|
+
// This module is browser compatible.
|
|
4
|
+
// A module to print ANSI terminal colors. Inspired by chalk, kleur, and colors
|
|
5
|
+
// on npm.
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.bold = bold;
|
|
8
|
+
exports.red = red;
|
|
9
|
+
exports.green = green;
|
|
10
|
+
exports.yellow = yellow;
|
|
11
|
+
exports.white = white;
|
|
12
|
+
exports.gray = gray;
|
|
13
|
+
exports.brightBlack = brightBlack;
|
|
14
|
+
exports.bgRed = bgRed;
|
|
15
|
+
exports.bgGreen = bgGreen;
|
|
16
|
+
exports.stripAnsiCode = stripAnsiCode;
|
|
17
|
+
const tslib_1 = require("tslib");
|
|
18
|
+
// This code is vendored from `fmt/colors.ts`.
|
|
19
|
+
// deno-lint-ignore no-explicit-any
|
|
20
|
+
const dntShim = tslib_1.__importStar(require("../../../../../_dnt.test_shims.js"));
|
|
21
|
+
const { Deno } = dntShim.dntGlobalThis;
|
|
22
|
+
const noColor = typeof (Deno === null || Deno === void 0 ? void 0 : Deno.noColor) === "boolean"
|
|
23
|
+
? Deno.noColor
|
|
24
|
+
: false;
|
|
25
|
+
const enabled = !noColor;
|
|
26
|
+
function code(open, close) {
|
|
27
|
+
return {
|
|
28
|
+
open: `\x1b[${open.join(";")}m`,
|
|
29
|
+
close: `\x1b[${close}m`,
|
|
30
|
+
regexp: new RegExp(`\\x1b\\[${close}m`, "g"),
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function run(str, code) {
|
|
34
|
+
return enabled
|
|
35
|
+
? `${code.open}${str.replace(code.regexp, code.open)}${code.close}`
|
|
36
|
+
: str;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Sets the style of text to be printed to bold.
|
|
40
|
+
*
|
|
41
|
+
* Disable by setting the `NO_COLOR` environmental variable.
|
|
42
|
+
*
|
|
43
|
+
* @param str Text to make bold
|
|
44
|
+
*
|
|
45
|
+
* @returns Bold text for printing
|
|
46
|
+
*
|
|
47
|
+
* @example Usage
|
|
48
|
+
* ```ts no-assert
|
|
49
|
+
* import { bold } from "@std/internal/styles";
|
|
50
|
+
*
|
|
51
|
+
* console.log(bold("Hello, world!")); // Prints "Hello, world!" in bold
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
function bold(str) {
|
|
55
|
+
return run(str, code([1], 22));
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Sets the color of text to be printed to red.
|
|
59
|
+
*
|
|
60
|
+
* Disable by setting the `NO_COLOR` environmental variable.
|
|
61
|
+
*
|
|
62
|
+
* @param str Text to make red
|
|
63
|
+
*
|
|
64
|
+
* @returns Red text for printing
|
|
65
|
+
*
|
|
66
|
+
* @example Usage
|
|
67
|
+
* ```ts no-assert
|
|
68
|
+
* import { red } from "@std/internal/styles";
|
|
69
|
+
*
|
|
70
|
+
* console.log(red("Hello, world!")); // Prints "Hello, world!" in red
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
function red(str) {
|
|
74
|
+
return run(str, code([31], 39));
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Sets the color of text to be printed to green.
|
|
78
|
+
*
|
|
79
|
+
* Disable by setting the `NO_COLOR` environmental variable.
|
|
80
|
+
*
|
|
81
|
+
* @param str Text to make green
|
|
82
|
+
*
|
|
83
|
+
* @returns Green text for print
|
|
84
|
+
*
|
|
85
|
+
* @example Usage
|
|
86
|
+
* ```ts no-assert
|
|
87
|
+
* import { green } from "@std/internal/styles";
|
|
88
|
+
*
|
|
89
|
+
* console.log(green("Hello, world!")); // Prints "Hello, world!" in green
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
function green(str) {
|
|
93
|
+
return run(str, code([32], 39));
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Sets the color of text to be printed to yellow.
|
|
97
|
+
*
|
|
98
|
+
* Disable by setting the `NO_COLOR` environmental variable.
|
|
99
|
+
*
|
|
100
|
+
* @param str Text to make yellow
|
|
101
|
+
*
|
|
102
|
+
* @returns Yellow text for print
|
|
103
|
+
*
|
|
104
|
+
* @example Usage
|
|
105
|
+
* ```ts no-assert
|
|
106
|
+
* import { yellow } from "@std/internal/styles";
|
|
107
|
+
*
|
|
108
|
+
* console.log(yellow("Hello, world!")); // Prints "Hello, world!" in yellow
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
111
|
+
function yellow(str) {
|
|
112
|
+
return run(str, code([33], 39));
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Sets the color of text to be printed to white.
|
|
116
|
+
*
|
|
117
|
+
* @param str Text to make white
|
|
118
|
+
*
|
|
119
|
+
* @returns White text for print
|
|
120
|
+
*
|
|
121
|
+
* @example Usage
|
|
122
|
+
* ```ts no-assert
|
|
123
|
+
* import { white } from "@std/internal/styles";
|
|
124
|
+
*
|
|
125
|
+
* console.log(white("Hello, world!")); // Prints "Hello, world!" in white
|
|
126
|
+
* ```
|
|
127
|
+
*/
|
|
128
|
+
function white(str) {
|
|
129
|
+
return run(str, code([37], 39));
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Sets the color of text to be printed to gray.
|
|
133
|
+
*
|
|
134
|
+
* @param str Text to make gray
|
|
135
|
+
*
|
|
136
|
+
* @returns Gray text for print
|
|
137
|
+
*
|
|
138
|
+
* @example Usage
|
|
139
|
+
* ```ts no-assert
|
|
140
|
+
* import { gray } from "@std/internal/styles";
|
|
141
|
+
*
|
|
142
|
+
* console.log(gray("Hello, world!")); // Prints "Hello, world!" in gray
|
|
143
|
+
* ```
|
|
144
|
+
*/
|
|
145
|
+
function gray(str) {
|
|
146
|
+
return brightBlack(str);
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Sets the color of text to be printed to bright-black.
|
|
150
|
+
*
|
|
151
|
+
* @param str Text to make bright-black
|
|
152
|
+
*
|
|
153
|
+
* @returns Bright-black text for print
|
|
154
|
+
*
|
|
155
|
+
* @example Usage
|
|
156
|
+
* ```ts no-assert
|
|
157
|
+
* import { brightBlack } from "@std/internal/styles";
|
|
158
|
+
*
|
|
159
|
+
* console.log(brightBlack("Hello, world!")); // Prints "Hello, world!" in bright-black
|
|
160
|
+
* ```
|
|
161
|
+
*/
|
|
162
|
+
function brightBlack(str) {
|
|
163
|
+
return run(str, code([90], 39));
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Sets the background color of text to be printed to red.
|
|
167
|
+
*
|
|
168
|
+
* @param str Text to make its background red
|
|
169
|
+
*
|
|
170
|
+
* @returns Red background text for print
|
|
171
|
+
*
|
|
172
|
+
* @example Usage
|
|
173
|
+
* ```ts no-assert
|
|
174
|
+
* import { bgRed } from "@std/internal/styles";
|
|
175
|
+
*
|
|
176
|
+
* console.log(bgRed("Hello, world!")); // Prints "Hello, world!" with red background
|
|
177
|
+
* ```
|
|
178
|
+
*/
|
|
179
|
+
function bgRed(str) {
|
|
180
|
+
return run(str, code([41], 49));
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Sets the background color of text to be printed to green.
|
|
184
|
+
*
|
|
185
|
+
* @param str Text to make its background green
|
|
186
|
+
*
|
|
187
|
+
* @returns Green background text for print
|
|
188
|
+
*
|
|
189
|
+
* @example Usage
|
|
190
|
+
* ```ts no-assert
|
|
191
|
+
* import { bgGreen } from "@std/internal/styles";
|
|
192
|
+
*
|
|
193
|
+
* console.log(bgGreen("Hello, world!")); // Prints "Hello, world!" with green background
|
|
194
|
+
* ```
|
|
195
|
+
*/
|
|
196
|
+
function bgGreen(str) {
|
|
197
|
+
return run(str, code([42], 49));
|
|
198
|
+
}
|
|
199
|
+
// https://github.com/chalk/ansi-regex/blob/02fa893d619d3da85411acc8fd4e2eea0e95a9d9/index.js
|
|
200
|
+
const ANSI_PATTERN = new RegExp([
|
|
201
|
+
"[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
|
|
202
|
+
"(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TXZcf-nq-uy=><~]))",
|
|
203
|
+
].join("|"), "g");
|
|
204
|
+
/**
|
|
205
|
+
* Remove ANSI escape codes from the string.
|
|
206
|
+
*
|
|
207
|
+
* @param string Text to remove ANSI escape codes from
|
|
208
|
+
*
|
|
209
|
+
* @returns Text without ANSI escape codes
|
|
210
|
+
*
|
|
211
|
+
* @example Usage
|
|
212
|
+
* ```ts no-assert
|
|
213
|
+
* import { red, stripAnsiCode } from "@std/internal/styles";
|
|
214
|
+
*
|
|
215
|
+
* console.log(stripAnsiCode(red("Hello, world!"))); // Prints "Hello, world!"
|
|
216
|
+
* ```
|
|
217
|
+
*/
|
|
218
|
+
function stripAnsiCode(string) {
|
|
219
|
+
return string.replace(ANSI_PATTERN, "");
|
|
220
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Ways that lines in a diff can be different. */
|
|
2
|
+
export type DiffType = "removed" | "common" | "added";
|
|
3
|
+
/**
|
|
4
|
+
* Represents the result of a diff operation.
|
|
5
|
+
*
|
|
6
|
+
* @typeParam T The type of the value in the diff result.
|
|
7
|
+
*/
|
|
8
|
+
export interface DiffResult<T> {
|
|
9
|
+
/** The type of the diff. */
|
|
10
|
+
type: DiffType;
|
|
11
|
+
/** The value of the diff. */
|
|
12
|
+
value: T;
|
|
13
|
+
/** The details of the diff. */
|
|
14
|
+
details?: DiffResult<T>[];
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/internal/1.0.4/types.ts"],"names":[],"mappings":"AAEA,kDAAkD;AAClD,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEtD;;;;GAIG;AACH,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,4BAA4B;IAC5B,IAAI,EAAE,QAAQ,CAAC;IACf,6BAA6B;IAC7B,KAAK,EAAE,CAAC,CAAC;IACT,+BAA+B;IAC/B,OAAO,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;CAC3B"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/** The options for creating a test suite with the describe function. */
|
|
2
|
+
import * as dntShim from "../../../../../_dnt.test_shims.js";
|
|
3
|
+
export interface DescribeDefinition<T> extends Omit<dntShim.Deno.TestDefinition, "fn"> {
|
|
4
|
+
/** The body of the test suite */
|
|
5
|
+
fn?: () => void | undefined;
|
|
6
|
+
/**
|
|
7
|
+
* The `describe` function returns a `TestSuite` representing the group of tests.
|
|
8
|
+
* If `describe` is called within another `describe` calls `fn`, the suite will default to that parent `describe` calls returned `TestSuite`.
|
|
9
|
+
* If `describe` is not called within another `describe` calls `fn`, the suite will default to the `TestSuite` representing the global group of tests.
|
|
10
|
+
*/
|
|
11
|
+
suite?: TestSuite<T>;
|
|
12
|
+
/** Run some shared setup before all of the tests in the suite. */
|
|
13
|
+
beforeAll?: ((this: T) => void | Promise<void>) | ((this: T) => void | Promise<void>)[];
|
|
14
|
+
/** Run some shared teardown after all of the tests in the suite. */
|
|
15
|
+
afterAll?: ((this: T) => void | Promise<void>) | ((this: T) => void | Promise<void>)[];
|
|
16
|
+
/** Run some shared setup before each test in the suite. */
|
|
17
|
+
beforeEach?: ((this: T) => void | Promise<void>) | ((this: T) => void | Promise<void>)[];
|
|
18
|
+
/** Run some shared teardown after each test in the suite. */
|
|
19
|
+
afterEach?: ((this: T) => void | Promise<void>) | ((this: T) => void | Promise<void>)[];
|
|
20
|
+
}
|
|
21
|
+
/** The options for creating an individual test case with the it function. */
|
|
22
|
+
export interface ItDefinition<T> extends Omit<dntShim.Deno.TestDefinition, "fn"> {
|
|
23
|
+
/** The body of the test case */
|
|
24
|
+
fn: (this: T, t: dntShim.Deno.TestContext) => void | Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* The `describe` function returns a `TestSuite` representing the group of tests.
|
|
27
|
+
* If `it` is called within a `describe` calls `fn`, the suite will default to that parent `describe` calls returned `TestSuite`.
|
|
28
|
+
* If `it` is not called within a `describe` calls `fn`, the suite will default to the `TestSuite` representing the global group of tests.
|
|
29
|
+
*/
|
|
30
|
+
suite?: TestSuite<T>;
|
|
31
|
+
}
|
|
32
|
+
/** The names of all the different types of hooks. */
|
|
33
|
+
export type HookNames = "beforeAll" | "afterAll" | "beforeEach" | "afterEach";
|
|
34
|
+
/**
|
|
35
|
+
* A group of tests.
|
|
36
|
+
*/
|
|
37
|
+
export interface TestSuite<T> {
|
|
38
|
+
/** The symbol to use for grouping the test suite */
|
|
39
|
+
symbol: symbol;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* An internal representation of a group of tests.
|
|
43
|
+
*/
|
|
44
|
+
export declare class TestSuiteInternal<T> implements TestSuite<T> {
|
|
45
|
+
symbol: symbol;
|
|
46
|
+
protected describe: DescribeDefinition<T>;
|
|
47
|
+
protected steps: (TestSuiteInternal<T> | ItDefinition<T>)[];
|
|
48
|
+
protected hasOnlyStep: boolean;
|
|
49
|
+
constructor(describe: DescribeDefinition<T>);
|
|
50
|
+
/** Stores how many test suites are executing. */
|
|
51
|
+
static runningCount: number;
|
|
52
|
+
/** If a test has been registered yet. Block adding global hooks if a test has been registered. */
|
|
53
|
+
static started: boolean;
|
|
54
|
+
/** A map of all test suites by symbol. */
|
|
55
|
+
static suites: Map<symbol, TestSuiteInternal<any>>;
|
|
56
|
+
/** The current test suite being registered. */
|
|
57
|
+
static current: TestSuiteInternal<any> | null;
|
|
58
|
+
/** The stack of tests that are actively running. */
|
|
59
|
+
static active: symbol[];
|
|
60
|
+
/** This is used internally for testing this module. */
|
|
61
|
+
static reset(): void;
|
|
62
|
+
/** This is used internally to register tests. */
|
|
63
|
+
static registerTest(options: dntShim.Deno.TestDefinition): void;
|
|
64
|
+
/** Updates all steps within top level suite to have ignore set to true if only is not set to true on step. */
|
|
65
|
+
static addingOnlyStep<T>(suite: TestSuiteInternal<T>): void;
|
|
66
|
+
/** This is used internally to add steps to a test suite. */
|
|
67
|
+
static addStep<T>(suite: TestSuiteInternal<T>, step: TestSuiteInternal<T> | ItDefinition<T>): void;
|
|
68
|
+
/** This is used internally to add hooks to a test suite. */
|
|
69
|
+
static setHook<T>(suite: TestSuiteInternal<T>, name: HookNames, fn: (this: T) => void | Promise<void>): void;
|
|
70
|
+
/** This is used internally to run all steps for a test suite. */
|
|
71
|
+
static run<T>(suite: TestSuiteInternal<T>, context: T, t: dntShim.Deno.TestContext): Promise<void>;
|
|
72
|
+
static runTest<T>(t: dntShim.Deno.TestContext, fn: (this: T, t: dntShim.Deno.TestContext) => void | Promise<void>, context: T, activeIndex?: number): Promise<void>;
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=_test_suite.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_test_suite.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/testing/1.0.3/_test_suite.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TestSuiteInternal = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
6
|
+
/** The options for creating a test suite with the describe function. */
|
|
7
|
+
const dntShim = tslib_1.__importStar(require("../../../../../_dnt.test_shims.js"));
|
|
8
|
+
/**
|
|
9
|
+
* An internal representation of a group of tests.
|
|
10
|
+
*/
|
|
11
|
+
class TestSuiteInternal {
|
|
12
|
+
constructor(describe) {
|
|
13
|
+
Object.defineProperty(this, "symbol", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
configurable: true,
|
|
16
|
+
writable: true,
|
|
17
|
+
value: void 0
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(this, "describe", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
configurable: true,
|
|
22
|
+
writable: true,
|
|
23
|
+
value: void 0
|
|
24
|
+
});
|
|
25
|
+
Object.defineProperty(this, "steps", {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
configurable: true,
|
|
28
|
+
writable: true,
|
|
29
|
+
value: void 0
|
|
30
|
+
});
|
|
31
|
+
Object.defineProperty(this, "hasOnlyStep", {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
configurable: true,
|
|
34
|
+
writable: true,
|
|
35
|
+
value: void 0
|
|
36
|
+
});
|
|
37
|
+
this.describe = describe;
|
|
38
|
+
this.steps = [];
|
|
39
|
+
this.hasOnlyStep = false;
|
|
40
|
+
const { suite } = describe;
|
|
41
|
+
if (suite && !TestSuiteInternal.suites.has(suite.symbol)) {
|
|
42
|
+
throw new Error("Cannot construct Test Suite: suite does not represent a registered test suite");
|
|
43
|
+
}
|
|
44
|
+
const testSuite = suite
|
|
45
|
+
? TestSuiteInternal.suites.get(suite.symbol)
|
|
46
|
+
: TestSuiteInternal.current;
|
|
47
|
+
this.symbol = Symbol();
|
|
48
|
+
TestSuiteInternal.suites.set(this.symbol, this);
|
|
49
|
+
const { fn } = describe;
|
|
50
|
+
if (fn) {
|
|
51
|
+
const temp = TestSuiteInternal.current;
|
|
52
|
+
TestSuiteInternal.current = this;
|
|
53
|
+
try {
|
|
54
|
+
// deno-lint-ignore no-explicit-any
|
|
55
|
+
const value = fn();
|
|
56
|
+
if (value instanceof Promise) {
|
|
57
|
+
throw new Error('Returning a Promise from "describe" is not supported: tests must be defined synchronously');
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
finally {
|
|
61
|
+
TestSuiteInternal.current = temp;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
if (testSuite) {
|
|
65
|
+
TestSuiteInternal.addStep(testSuite, this);
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
const { name, ignore, permissions, sanitizeExit, sanitizeOps, sanitizeResources, } = describe;
|
|
69
|
+
let { only } = describe;
|
|
70
|
+
if (!ignore && this.hasOnlyStep) {
|
|
71
|
+
only = true;
|
|
72
|
+
}
|
|
73
|
+
const options = {
|
|
74
|
+
name,
|
|
75
|
+
fn: async (t) => {
|
|
76
|
+
TestSuiteInternal.runningCount++;
|
|
77
|
+
try {
|
|
78
|
+
const context = {};
|
|
79
|
+
const { beforeAll } = this.describe;
|
|
80
|
+
if (typeof beforeAll === "function") {
|
|
81
|
+
await beforeAll.call(context);
|
|
82
|
+
}
|
|
83
|
+
else if (beforeAll) {
|
|
84
|
+
for (const hook of beforeAll) {
|
|
85
|
+
await hook.call(context);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
try {
|
|
89
|
+
TestSuiteInternal.active.push(this.symbol);
|
|
90
|
+
await TestSuiteInternal.run(this, context, t);
|
|
91
|
+
}
|
|
92
|
+
finally {
|
|
93
|
+
TestSuiteInternal.active.pop();
|
|
94
|
+
const { afterAll } = this.describe;
|
|
95
|
+
if (typeof afterAll === "function") {
|
|
96
|
+
await afterAll.call(context);
|
|
97
|
+
}
|
|
98
|
+
else if (afterAll) {
|
|
99
|
+
for (const hook of afterAll) {
|
|
100
|
+
await hook.call(context);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
finally {
|
|
106
|
+
TestSuiteInternal.runningCount--;
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
};
|
|
110
|
+
if (ignore !== undefined) {
|
|
111
|
+
options.ignore = ignore;
|
|
112
|
+
}
|
|
113
|
+
if (only !== undefined) {
|
|
114
|
+
options.only = only;
|
|
115
|
+
}
|
|
116
|
+
if (permissions !== undefined) {
|
|
117
|
+
options.permissions = permissions;
|
|
118
|
+
}
|
|
119
|
+
if (sanitizeExit !== undefined) {
|
|
120
|
+
options.sanitizeExit = sanitizeExit;
|
|
121
|
+
}
|
|
122
|
+
if (sanitizeOps !== undefined) {
|
|
123
|
+
options.sanitizeOps = sanitizeOps;
|
|
124
|
+
}
|
|
125
|
+
if (sanitizeResources !== undefined) {
|
|
126
|
+
options.sanitizeResources = sanitizeResources;
|
|
127
|
+
}
|
|
128
|
+
TestSuiteInternal.registerTest(options);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
/** This is used internally for testing this module. */
|
|
132
|
+
static reset() {
|
|
133
|
+
TestSuiteInternal.runningCount = 0;
|
|
134
|
+
TestSuiteInternal.started = false;
|
|
135
|
+
TestSuiteInternal.current = null;
|
|
136
|
+
TestSuiteInternal.active = [];
|
|
137
|
+
}
|
|
138
|
+
/** This is used internally to register tests. */
|
|
139
|
+
static registerTest(options) {
|
|
140
|
+
options = { ...options };
|
|
141
|
+
if (options.only === undefined) {
|
|
142
|
+
delete options.only;
|
|
143
|
+
}
|
|
144
|
+
if (options.permissions === undefined) {
|
|
145
|
+
delete options.permissions;
|
|
146
|
+
}
|
|
147
|
+
if (options.ignore === undefined) {
|
|
148
|
+
delete options.ignore;
|
|
149
|
+
}
|
|
150
|
+
if (options.sanitizeExit === undefined) {
|
|
151
|
+
delete options.sanitizeExit;
|
|
152
|
+
}
|
|
153
|
+
if (options.sanitizeOps === undefined) {
|
|
154
|
+
delete options.sanitizeOps;
|
|
155
|
+
}
|
|
156
|
+
if (options.sanitizeResources === undefined) {
|
|
157
|
+
delete options.sanitizeResources;
|
|
158
|
+
}
|
|
159
|
+
dntShim.Deno.test(options);
|
|
160
|
+
}
|
|
161
|
+
/** Updates all steps within top level suite to have ignore set to true if only is not set to true on step. */
|
|
162
|
+
static addingOnlyStep(suite) {
|
|
163
|
+
if (!suite.hasOnlyStep) {
|
|
164
|
+
for (let i = 0; i < suite.steps.length; i++) {
|
|
165
|
+
const step = suite.steps[i];
|
|
166
|
+
if (!(step instanceof TestSuiteInternal) && !step.only) {
|
|
167
|
+
suite.steps.splice(i--, 1);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
suite.hasOnlyStep = true;
|
|
171
|
+
}
|
|
172
|
+
const parentSuite = suite.describe.suite;
|
|
173
|
+
const parentTestSuite = parentSuite &&
|
|
174
|
+
TestSuiteInternal.suites.get(parentSuite.symbol);
|
|
175
|
+
if (parentTestSuite) {
|
|
176
|
+
TestSuiteInternal.addingOnlyStep(parentTestSuite);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
/** This is used internally to add steps to a test suite. */
|
|
180
|
+
static addStep(suite, step) {
|
|
181
|
+
if (!suite.hasOnlyStep) {
|
|
182
|
+
if (step instanceof TestSuiteInternal) {
|
|
183
|
+
if (step.hasOnlyStep || step.describe.only) {
|
|
184
|
+
TestSuiteInternal.addingOnlyStep(suite);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
if (step.only)
|
|
189
|
+
TestSuiteInternal.addingOnlyStep(suite);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
if (!(suite.hasOnlyStep && !(step instanceof TestSuiteInternal) && !step.only)) {
|
|
193
|
+
suite.steps.push(step);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
/** This is used internally to add hooks to a test suite. */
|
|
197
|
+
static setHook(suite, name, fn) {
|
|
198
|
+
if (suite.describe[name]) {
|
|
199
|
+
if (typeof suite.describe[name] === "function") {
|
|
200
|
+
suite.describe[name] = [
|
|
201
|
+
suite.describe[name],
|
|
202
|
+
];
|
|
203
|
+
}
|
|
204
|
+
suite.describe[name].push(fn);
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
suite.describe[name] = fn;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
/** This is used internally to run all steps for a test suite. */
|
|
211
|
+
static async run(suite, context, t) {
|
|
212
|
+
const hasOnly = suite.hasOnlyStep || suite.describe.only || false;
|
|
213
|
+
for (const step of suite.steps) {
|
|
214
|
+
if (hasOnly && step instanceof TestSuiteInternal &&
|
|
215
|
+
!(step.hasOnlyStep || step.describe.only || false)) {
|
|
216
|
+
continue;
|
|
217
|
+
}
|
|
218
|
+
const { name, fn, ignore, permissions, sanitizeExit, sanitizeOps, sanitizeResources, } = step instanceof TestSuiteInternal ? step.describe : step;
|
|
219
|
+
const options = {
|
|
220
|
+
name,
|
|
221
|
+
fn: async (t) => {
|
|
222
|
+
if (permissions) {
|
|
223
|
+
throw new Error("permissions option not available for nested tests");
|
|
224
|
+
}
|
|
225
|
+
context = { ...context };
|
|
226
|
+
if (step instanceof TestSuiteInternal) {
|
|
227
|
+
const { beforeAll } = step.describe;
|
|
228
|
+
if (typeof beforeAll === "function") {
|
|
229
|
+
await beforeAll.call(context);
|
|
230
|
+
}
|
|
231
|
+
else if (beforeAll) {
|
|
232
|
+
for (const hook of beforeAll) {
|
|
233
|
+
await hook.call(context);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
try {
|
|
237
|
+
TestSuiteInternal.active.push(step.symbol);
|
|
238
|
+
await TestSuiteInternal.run(step, context, t);
|
|
239
|
+
}
|
|
240
|
+
finally {
|
|
241
|
+
TestSuiteInternal.active.pop();
|
|
242
|
+
const { afterAll } = step.describe;
|
|
243
|
+
if (typeof afterAll === "function") {
|
|
244
|
+
await afterAll.call(context);
|
|
245
|
+
}
|
|
246
|
+
else if (afterAll) {
|
|
247
|
+
for (const hook of afterAll) {
|
|
248
|
+
await hook.call(context);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
else {
|
|
254
|
+
await TestSuiteInternal.runTest(t, fn, context);
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
};
|
|
258
|
+
if (ignore !== undefined) {
|
|
259
|
+
options.ignore = ignore;
|
|
260
|
+
}
|
|
261
|
+
if (sanitizeExit !== undefined) {
|
|
262
|
+
options.sanitizeExit = sanitizeExit;
|
|
263
|
+
}
|
|
264
|
+
if (sanitizeOps !== undefined) {
|
|
265
|
+
options.sanitizeOps = sanitizeOps;
|
|
266
|
+
}
|
|
267
|
+
if (sanitizeResources !== undefined) {
|
|
268
|
+
options.sanitizeResources = sanitizeResources;
|
|
269
|
+
}
|
|
270
|
+
await t.step(options);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
static async runTest(t, fn, context, activeIndex = 0) {
|
|
274
|
+
const suite = TestSuiteInternal.active[activeIndex];
|
|
275
|
+
const testSuite = suite && TestSuiteInternal.suites.get(suite);
|
|
276
|
+
if (testSuite) {
|
|
277
|
+
if (activeIndex === 0)
|
|
278
|
+
context = { ...context };
|
|
279
|
+
const { beforeEach } = testSuite.describe;
|
|
280
|
+
if (typeof beforeEach === "function") {
|
|
281
|
+
await beforeEach.call(context);
|
|
282
|
+
}
|
|
283
|
+
else if (beforeEach) {
|
|
284
|
+
for (const hook of beforeEach) {
|
|
285
|
+
await hook.call(context);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
try {
|
|
289
|
+
await TestSuiteInternal.runTest(t, fn, context, activeIndex + 1);
|
|
290
|
+
}
|
|
291
|
+
finally {
|
|
292
|
+
const { afterEach } = testSuite.describe;
|
|
293
|
+
if (typeof afterEach === "function") {
|
|
294
|
+
await afterEach.call(context);
|
|
295
|
+
}
|
|
296
|
+
else if (afterEach) {
|
|
297
|
+
for (const hook of afterEach) {
|
|
298
|
+
await hook.call(context);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
else {
|
|
304
|
+
await fn.call(context, t);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
exports.TestSuiteInternal = TestSuiteInternal;
|
|
309
|
+
/** Stores how many test suites are executing. */
|
|
310
|
+
Object.defineProperty(TestSuiteInternal, "runningCount", {
|
|
311
|
+
enumerable: true,
|
|
312
|
+
configurable: true,
|
|
313
|
+
writable: true,
|
|
314
|
+
value: 0
|
|
315
|
+
});
|
|
316
|
+
/** If a test has been registered yet. Block adding global hooks if a test has been registered. */
|
|
317
|
+
Object.defineProperty(TestSuiteInternal, "started", {
|
|
318
|
+
enumerable: true,
|
|
319
|
+
configurable: true,
|
|
320
|
+
writable: true,
|
|
321
|
+
value: false
|
|
322
|
+
});
|
|
323
|
+
/** A map of all test suites by symbol. */
|
|
324
|
+
// deno-lint-ignore no-explicit-any
|
|
325
|
+
Object.defineProperty(TestSuiteInternal, "suites", {
|
|
326
|
+
enumerable: true,
|
|
327
|
+
configurable: true,
|
|
328
|
+
writable: true,
|
|
329
|
+
value: new Map()
|
|
330
|
+
});
|
|
331
|
+
/** The current test suite being registered. */
|
|
332
|
+
// deno-lint-ignore no-explicit-any
|
|
333
|
+
Object.defineProperty(TestSuiteInternal, "current", {
|
|
334
|
+
enumerable: true,
|
|
335
|
+
configurable: true,
|
|
336
|
+
writable: true,
|
|
337
|
+
value: null
|
|
338
|
+
});
|
|
339
|
+
/** The stack of tests that are actively running. */
|
|
340
|
+
Object.defineProperty(TestSuiteInternal, "active", {
|
|
341
|
+
enumerable: true,
|
|
342
|
+
configurable: true,
|
|
343
|
+
writable: true,
|
|
344
|
+
value: []
|
|
345
|
+
});
|