ibm-cloud-sdk-core 4.3.2 → 4.3.4
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/CHANGELOG.md +7 -0
- package/es/lib/sdk-test-helpers.js +1 -2
- package/iamtest.env +3 -0
- package/lib/sdk-test-helpers.js +11 -9
- package/package.json +3 -2
- package/sdk-test-utilities/node_modules/.package-lock.json +508 -0
- package/sdk-test-utilities/node_modules/@babel/code-frame/LICENSE +22 -0
- package/sdk-test-utilities/node_modules/@babel/code-frame/README.md +19 -0
- package/sdk-test-utilities/node_modules/@babel/code-frame/lib/index.js +156 -0
- package/sdk-test-utilities/node_modules/@babel/code-frame/lib/index.js.map +1 -0
- package/sdk-test-utilities/node_modules/@babel/code-frame/package.json +30 -0
- package/sdk-test-utilities/node_modules/@babel/helper-validator-identifier/LICENSE +22 -0
- package/sdk-test-utilities/node_modules/@babel/helper-validator-identifier/README.md +19 -0
- package/sdk-test-utilities/node_modules/@babel/helper-validator-identifier/lib/identifier.js +70 -0
- package/sdk-test-utilities/node_modules/@babel/helper-validator-identifier/lib/identifier.js.map +1 -0
- package/sdk-test-utilities/node_modules/@babel/helper-validator-identifier/lib/index.js +57 -0
- package/sdk-test-utilities/node_modules/@babel/helper-validator-identifier/lib/index.js.map +1 -0
- package/sdk-test-utilities/node_modules/@babel/helper-validator-identifier/lib/keyword.js +35 -0
- package/sdk-test-utilities/node_modules/@babel/helper-validator-identifier/lib/keyword.js.map +1 -0
- package/sdk-test-utilities/node_modules/@babel/helper-validator-identifier/package.json +31 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/LICENSE +22 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/README.md +19 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/lib/index.js +119 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/lib/index.js.map +1 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/ansi-styles/index.js +165 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/ansi-styles/license +9 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/ansi-styles/package.json +56 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/ansi-styles/readme.md +147 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/chalk/index.js +228 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/chalk/index.js.flow +93 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/chalk/license +9 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/chalk/package.json +71 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/chalk/readme.md +314 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/chalk/templates.js +128 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/chalk/types/index.d.ts +97 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/color-convert/CHANGELOG.md +54 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/color-convert/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/color-convert/README.md +68 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/color-convert/conversions.js +868 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/color-convert/index.js +78 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/color-convert/package.json +46 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/color-convert/route.js +97 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/color-name/.eslintrc.json +43 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/color-name/LICENSE +8 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/color-name/README.md +11 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/color-name/index.js +152 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/color-name/package.json +25 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/color-name/test.js +7 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/escape-string-regexp/index.js +11 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/escape-string-regexp/license +21 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/escape-string-regexp/package.json +41 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/escape-string-regexp/readme.md +27 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/has-flag/index.js +8 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/has-flag/license +9 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/has-flag/package.json +44 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/has-flag/readme.md +70 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/supports-color/browser.js +5 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/supports-color/index.js +131 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/supports-color/license +9 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/supports-color/package.json +53 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/supports-color/readme.md +66 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/package.json +30 -0
- package/sdk-test-utilities/node_modules/@jest/expect-utils/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/@jest/expect-utils/README.md +5 -0
- package/sdk-test-utilities/node_modules/@jest/expect-utils/build/immutableUtils.js +66 -0
- package/sdk-test-utilities/node_modules/@jest/expect-utils/build/index.d.ts +94 -0
- package/sdk-test-utilities/node_modules/@jest/expect-utils/build/index.js +34 -0
- package/sdk-test-utilities/node_modules/@jest/expect-utils/build/jasmineUtils.js +218 -0
- package/sdk-test-utilities/node_modules/@jest/expect-utils/build/types.js +1 -0
- package/sdk-test-utilities/node_modules/@jest/expect-utils/build/utils.js +462 -0
- package/sdk-test-utilities/node_modules/@jest/expect-utils/package.json +35 -0
- package/sdk-test-utilities/node_modules/@jest/schemas/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/@jest/schemas/README.md +3 -0
- package/sdk-test-utilities/node_modules/@jest/schemas/build/index.d.ts +63 -0
- package/sdk-test-utilities/node_modules/@jest/schemas/build/index.js +60 -0
- package/sdk-test-utilities/node_modules/@jest/schemas/package.json +29 -0
- package/sdk-test-utilities/node_modules/@jest/types/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/@jest/types/README.md +30 -0
- package/sdk-test-utilities/node_modules/@jest/types/build/Circus.js +1 -0
- package/sdk-test-utilities/node_modules/@jest/types/build/Config.js +1 -0
- package/sdk-test-utilities/node_modules/@jest/types/build/Global.js +1 -0
- package/sdk-test-utilities/node_modules/@jest/types/build/TestResult.js +1 -0
- package/sdk-test-utilities/node_modules/@jest/types/build/index.d.ts +1204 -0
- package/sdk-test-utilities/node_modules/@jest/types/build/index.js +1 -0
- package/sdk-test-utilities/node_modules/@jest/types/package.json +38 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/compiler/compiler.d.ts +35 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/compiler/compiler.js +577 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/compiler/index.d.ts +2 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/compiler/index.js +47 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/errors/errors.d.ts +88 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/errors/errors.js +609 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/errors/index.d.ts +1 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/errors/index.js +44 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/license +23 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/package.json +47 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/readme.md +1424 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/system/index.d.ts +1 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/system/index.js +44 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/system/system.d.ts +26 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/system/system.js +90 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/typebox.d.ts +723 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/typebox.js +2220 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/cast.d.ts +30 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/cast.js +372 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/check.d.ts +12 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/check.js +484 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/clone.d.ts +3 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/clone.js +71 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/convert.d.ts +13 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/convert.js +372 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/create.d.ts +26 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/create.js +480 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/delta.d.ts +43 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/delta.js +204 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/equal.d.ts +3 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/equal.js +80 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/hash.d.ts +8 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/hash.js +208 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/index.d.ts +6 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/index.js +56 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/is.d.ts +11 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/is.js +53 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/mutate.d.ts +13 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/mutate.js +121 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/pointer.d.ts +24 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/pointer.js +142 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/value.d.ts +39 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/value.js +99 -0
- package/sdk-test-utilities/node_modules/@types/istanbul-lib-coverage/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/@types/istanbul-lib-coverage/README.md +15 -0
- package/sdk-test-utilities/node_modules/@types/istanbul-lib-coverage/index.d.ts +111 -0
- package/sdk-test-utilities/node_modules/@types/istanbul-lib-coverage/package.json +25 -0
- package/sdk-test-utilities/node_modules/@types/istanbul-lib-report/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/@types/istanbul-lib-report/README.md +15 -0
- package/sdk-test-utilities/node_modules/@types/istanbul-lib-report/index.d.ts +184 -0
- package/sdk-test-utilities/node_modules/@types/istanbul-lib-report/package.json +32 -0
- package/sdk-test-utilities/node_modules/@types/istanbul-reports/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/@types/istanbul-reports/README.md +86 -0
- package/sdk-test-utilities/node_modules/@types/istanbul-reports/index.d.ts +67 -0
- package/sdk-test-utilities/node_modules/@types/istanbul-reports/package.json +32 -0
- package/sdk-test-utilities/node_modules/@types/node/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/@types/node/README.md +15 -0
- package/sdk-test-utilities/node_modules/@types/node/assert/strict.d.ts +8 -0
- package/sdk-test-utilities/node_modules/@types/node/assert.d.ts +1040 -0
- package/sdk-test-utilities/node_modules/@types/node/async_hooks.d.ts +541 -0
- package/sdk-test-utilities/node_modules/@types/node/buffer.d.ts +2363 -0
- package/sdk-test-utilities/node_modules/@types/node/child_process.d.ts +1544 -0
- package/sdk-test-utilities/node_modules/@types/node/cluster.d.ts +578 -0
- package/sdk-test-utilities/node_modules/@types/node/console.d.ts +452 -0
- package/sdk-test-utilities/node_modules/@types/node/constants.d.ts +19 -0
- package/sdk-test-utilities/node_modules/@types/node/crypto.d.ts +4523 -0
- package/sdk-test-utilities/node_modules/@types/node/dgram.d.ts +596 -0
- package/sdk-test-utilities/node_modules/@types/node/diagnostics_channel.d.ts +554 -0
- package/sdk-test-utilities/node_modules/@types/node/dns/promises.d.ts +474 -0
- package/sdk-test-utilities/node_modules/@types/node/dns.d.ts +864 -0
- package/sdk-test-utilities/node_modules/@types/node/dom-events.d.ts +124 -0
- package/sdk-test-utilities/node_modules/@types/node/domain.d.ts +170 -0
- package/sdk-test-utilities/node_modules/@types/node/events.d.ts +909 -0
- package/sdk-test-utilities/node_modules/@types/node/fs/promises.d.ts +1245 -0
- package/sdk-test-utilities/node_modules/@types/node/fs.d.ts +4317 -0
- package/sdk-test-utilities/node_modules/@types/node/globals.d.ts +411 -0
- package/sdk-test-utilities/node_modules/@types/node/globals.global.d.ts +1 -0
- package/sdk-test-utilities/node_modules/@types/node/http.d.ts +1908 -0
- package/sdk-test-utilities/node_modules/@types/node/http2.d.ts +2418 -0
- package/sdk-test-utilities/node_modules/@types/node/https.d.ts +550 -0
- package/sdk-test-utilities/node_modules/@types/node/index.d.ts +89 -0
- package/sdk-test-utilities/node_modules/@types/node/inspector.d.ts +2746 -0
- package/sdk-test-utilities/node_modules/@types/node/module.d.ts +315 -0
- package/sdk-test-utilities/node_modules/@types/node/net.d.ts +999 -0
- package/sdk-test-utilities/node_modules/@types/node/os.d.ts +495 -0
- package/sdk-test-utilities/node_modules/@types/node/package.json +217 -0
- package/sdk-test-utilities/node_modules/@types/node/path.d.ts +191 -0
- package/sdk-test-utilities/node_modules/@types/node/perf_hooks.d.ts +905 -0
- package/sdk-test-utilities/node_modules/@types/node/process.d.ts +1754 -0
- package/sdk-test-utilities/node_modules/@types/node/punycode.d.ts +117 -0
- package/sdk-test-utilities/node_modules/@types/node/querystring.d.ts +153 -0
- package/sdk-test-utilities/node_modules/@types/node/readline/promises.d.ts +150 -0
- package/sdk-test-utilities/node_modules/@types/node/readline.d.ts +540 -0
- package/sdk-test-utilities/node_modules/@types/node/repl.d.ts +430 -0
- package/sdk-test-utilities/node_modules/@types/node/sea.d.ts +153 -0
- package/sdk-test-utilities/node_modules/@types/node/stream/consumers.d.ts +12 -0
- package/sdk-test-utilities/node_modules/@types/node/stream/promises.d.ts +83 -0
- package/sdk-test-utilities/node_modules/@types/node/stream/web.d.ts +367 -0
- package/sdk-test-utilities/node_modules/@types/node/stream.d.ts +1707 -0
- package/sdk-test-utilities/node_modules/@types/node/string_decoder.d.ts +67 -0
- package/sdk-test-utilities/node_modules/@types/node/test.d.ts +1718 -0
- package/sdk-test-utilities/node_modules/@types/node/timers/promises.d.ts +97 -0
- package/sdk-test-utilities/node_modules/@types/node/timers.d.ts +240 -0
- package/sdk-test-utilities/node_modules/@types/node/tls.d.ts +1217 -0
- package/sdk-test-utilities/node_modules/@types/node/trace_events.d.ts +197 -0
- package/sdk-test-utilities/node_modules/@types/node/tty.d.ts +208 -0
- package/sdk-test-utilities/node_modules/@types/node/url.d.ts +952 -0
- package/sdk-test-utilities/node_modules/@types/node/util.d.ts +2292 -0
- package/sdk-test-utilities/node_modules/@types/node/v8.d.ts +808 -0
- package/sdk-test-utilities/node_modules/@types/node/vm.d.ts +924 -0
- package/sdk-test-utilities/node_modules/@types/node/wasi.d.ts +181 -0
- package/sdk-test-utilities/node_modules/@types/node/worker_threads.d.ts +691 -0
- package/sdk-test-utilities/node_modules/@types/node/zlib.d.ts +530 -0
- package/sdk-test-utilities/node_modules/@types/stack-utils/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/@types/stack-utils/README.md +78 -0
- package/sdk-test-utilities/node_modules/@types/stack-utils/index.d.ts +59 -0
- package/sdk-test-utilities/node_modules/@types/stack-utils/package.json +25 -0
- package/sdk-test-utilities/node_modules/@types/yargs/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/@types/yargs/README.md +15 -0
- package/sdk-test-utilities/node_modules/@types/yargs/helpers.d.mts +1 -0
- package/sdk-test-utilities/node_modules/@types/yargs/helpers.d.ts +5 -0
- package/sdk-test-utilities/node_modules/@types/yargs/index.d.mts +46 -0
- package/sdk-test-utilities/node_modules/@types/yargs/index.d.ts +1031 -0
- package/sdk-test-utilities/node_modules/@types/yargs/package.json +87 -0
- package/sdk-test-utilities/node_modules/@types/yargs/yargs.d.ts +9 -0
- package/sdk-test-utilities/node_modules/@types/yargs-parser/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/@types/yargs-parser/README.md +15 -0
- package/sdk-test-utilities/node_modules/@types/yargs-parser/index.d.ts +112 -0
- package/sdk-test-utilities/node_modules/@types/yargs-parser/package.json +25 -0
- package/sdk-test-utilities/node_modules/ansi-styles/index.d.ts +345 -0
- package/sdk-test-utilities/node_modules/ansi-styles/index.js +163 -0
- package/sdk-test-utilities/node_modules/ansi-styles/license +9 -0
- package/sdk-test-utilities/node_modules/ansi-styles/package.json +56 -0
- package/sdk-test-utilities/node_modules/ansi-styles/readme.md +152 -0
- package/sdk-test-utilities/node_modules/braces/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/braces/README.md +586 -0
- package/sdk-test-utilities/node_modules/braces/index.js +170 -0
- package/sdk-test-utilities/node_modules/braces/lib/compile.js +60 -0
- package/sdk-test-utilities/node_modules/braces/lib/constants.js +57 -0
- package/sdk-test-utilities/node_modules/braces/lib/expand.js +113 -0
- package/sdk-test-utilities/node_modules/braces/lib/parse.js +331 -0
- package/sdk-test-utilities/node_modules/braces/lib/stringify.js +32 -0
- package/sdk-test-utilities/node_modules/braces/lib/utils.js +122 -0
- package/sdk-test-utilities/node_modules/braces/package.json +77 -0
- package/sdk-test-utilities/node_modules/chalk/index.d.ts +415 -0
- package/sdk-test-utilities/node_modules/chalk/license +9 -0
- package/sdk-test-utilities/node_modules/chalk/package.json +68 -0
- package/sdk-test-utilities/node_modules/chalk/readme.md +341 -0
- package/sdk-test-utilities/node_modules/chalk/source/index.js +229 -0
- package/sdk-test-utilities/node_modules/chalk/source/templates.js +134 -0
- package/sdk-test-utilities/node_modules/chalk/source/util.js +39 -0
- package/sdk-test-utilities/node_modules/ci-info/CHANGELOG.md +178 -0
- package/sdk-test-utilities/node_modules/ci-info/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/ci-info/README.md +135 -0
- package/sdk-test-utilities/node_modules/ci-info/index.d.ts +75 -0
- package/sdk-test-utilities/node_modules/ci-info/index.js +90 -0
- package/sdk-test-utilities/node_modules/ci-info/package.json +45 -0
- package/sdk-test-utilities/node_modules/ci-info/vendors.json +321 -0
- package/sdk-test-utilities/node_modules/color-convert/CHANGELOG.md +54 -0
- package/sdk-test-utilities/node_modules/color-convert/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/color-convert/README.md +68 -0
- package/sdk-test-utilities/node_modules/color-convert/conversions.js +839 -0
- package/sdk-test-utilities/node_modules/color-convert/index.js +81 -0
- package/sdk-test-utilities/node_modules/color-convert/package.json +48 -0
- package/sdk-test-utilities/node_modules/color-convert/route.js +97 -0
- package/sdk-test-utilities/node_modules/color-name/LICENSE +8 -0
- package/sdk-test-utilities/node_modules/color-name/README.md +11 -0
- package/sdk-test-utilities/node_modules/color-name/index.js +152 -0
- package/sdk-test-utilities/node_modules/color-name/package.json +28 -0
- package/sdk-test-utilities/node_modules/diff-sequences/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/diff-sequences/README.md +404 -0
- package/sdk-test-utilities/node_modules/diff-sequences/build/index.d.ts +38 -0
- package/sdk-test-utilities/node_modules/diff-sequences/build/index.js +798 -0
- package/sdk-test-utilities/node_modules/diff-sequences/package.json +39 -0
- package/sdk-test-utilities/node_modules/escape-string-regexp/index.d.ts +18 -0
- package/sdk-test-utilities/node_modules/escape-string-regexp/index.js +11 -0
- package/sdk-test-utilities/node_modules/escape-string-regexp/license +9 -0
- package/sdk-test-utilities/node_modules/escape-string-regexp/package.json +43 -0
- package/sdk-test-utilities/node_modules/escape-string-regexp/readme.md +29 -0
- package/sdk-test-utilities/node_modules/expect/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/expect/README.md +3 -0
- package/sdk-test-utilities/node_modules/expect/build/asymmetricMatchers.js +375 -0
- package/sdk-test-utilities/node_modules/expect/build/extractExpectedAssertionsErrors.js +86 -0
- package/sdk-test-utilities/node_modules/expect/build/index.d.ts +370 -0
- package/sdk-test-utilities/node_modules/expect/build/index.js +410 -0
- package/sdk-test-utilities/node_modules/expect/build/jestMatchersObject.js +123 -0
- package/sdk-test-utilities/node_modules/expect/build/matchers.js +1292 -0
- package/sdk-test-utilities/node_modules/expect/build/print.js +122 -0
- package/sdk-test-utilities/node_modules/expect/build/spyMatchers.js +1254 -0
- package/sdk-test-utilities/node_modules/expect/build/toThrowMatchers.js +481 -0
- package/sdk-test-utilities/node_modules/expect/build/types.js +3 -0
- package/sdk-test-utilities/node_modules/expect/package.json +43 -0
- package/sdk-test-utilities/node_modules/fill-range/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/fill-range/README.md +237 -0
- package/sdk-test-utilities/node_modules/fill-range/index.js +248 -0
- package/sdk-test-utilities/node_modules/fill-range/package.json +74 -0
- package/sdk-test-utilities/node_modules/graceful-fs/LICENSE +15 -0
- package/sdk-test-utilities/node_modules/graceful-fs/README.md +143 -0
- package/sdk-test-utilities/node_modules/graceful-fs/clone.js +23 -0
- package/sdk-test-utilities/node_modules/graceful-fs/graceful-fs.js +448 -0
- package/sdk-test-utilities/node_modules/graceful-fs/legacy-streams.js +118 -0
- package/sdk-test-utilities/node_modules/graceful-fs/package.json +53 -0
- package/sdk-test-utilities/node_modules/graceful-fs/polyfills.js +355 -0
- package/sdk-test-utilities/node_modules/has-flag/index.d.ts +39 -0
- package/sdk-test-utilities/node_modules/has-flag/index.js +8 -0
- package/sdk-test-utilities/node_modules/has-flag/license +9 -0
- package/sdk-test-utilities/node_modules/has-flag/package.json +46 -0
- package/sdk-test-utilities/node_modules/has-flag/readme.md +89 -0
- package/sdk-test-utilities/node_modules/is-number/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/is-number/README.md +187 -0
- package/sdk-test-utilities/node_modules/is-number/index.js +18 -0
- package/sdk-test-utilities/node_modules/is-number/package.json +82 -0
- package/sdk-test-utilities/node_modules/jest-diff/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/jest-diff/README.md +671 -0
- package/sdk-test-utilities/node_modules/jest-diff/build/cleanupSemantic.js +599 -0
- package/sdk-test-utilities/node_modules/jest-diff/build/constants.js +19 -0
- package/sdk-test-utilities/node_modules/jest-diff/build/diffLines.js +193 -0
- package/sdk-test-utilities/node_modules/jest-diff/build/diffStrings.js +66 -0
- package/sdk-test-utilities/node_modules/jest-diff/build/getAlignedDiffs.js +223 -0
- package/sdk-test-utilities/node_modules/jest-diff/build/index.d.ts +93 -0
- package/sdk-test-utilities/node_modules/jest-diff/build/index.js +232 -0
- package/sdk-test-utilities/node_modules/jest-diff/build/joinAlignedDiffs.js +271 -0
- package/sdk-test-utilities/node_modules/jest-diff/build/normalizeDiffOptions.js +59 -0
- package/sdk-test-utilities/node_modules/jest-diff/build/printDiffs.js +79 -0
- package/sdk-test-utilities/node_modules/jest-diff/build/types.js +1 -0
- package/sdk-test-utilities/node_modules/jest-diff/package.json +36 -0
- package/sdk-test-utilities/node_modules/jest-get-type/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/jest-get-type/build/index.d.ts +27 -0
- package/sdk-test-utilities/node_modules/jest-get-type/build/index.js +53 -0
- package/sdk-test-utilities/node_modules/jest-get-type/package.json +27 -0
- package/sdk-test-utilities/node_modules/jest-matcher-utils/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/jest-matcher-utils/README.md +24 -0
- package/sdk-test-utilities/node_modules/jest-matcher-utils/build/Replaceable.js +64 -0
- package/sdk-test-utilities/node_modules/jest-matcher-utils/build/deepCyclicCopyReplaceable.js +111 -0
- package/sdk-test-utilities/node_modules/jest-matcher-utils/build/index.d.ts +138 -0
- package/sdk-test-utilities/node_modules/jest-matcher-utils/build/index.js +542 -0
- package/sdk-test-utilities/node_modules/jest-matcher-utils/package.json +37 -0
- package/sdk-test-utilities/node_modules/jest-message-util/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/jest-message-util/build/index.d.ts +68 -0
- package/sdk-test-utilities/node_modules/jest-message-util/build/index.js +518 -0
- package/sdk-test-utilities/node_modules/jest-message-util/build/types.js +1 -0
- package/sdk-test-utilities/node_modules/jest-message-util/package.json +43 -0
- package/sdk-test-utilities/node_modules/jest-util/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/jest-util/Readme.md +87 -0
- package/sdk-test-utilities/node_modules/jest-util/build/ErrorWithStack.js +28 -0
- package/sdk-test-utilities/node_modules/jest-util/build/clearLine.js +18 -0
- package/sdk-test-utilities/node_modules/jest-util/build/convertDescriptorToString.js +30 -0
- package/sdk-test-utilities/node_modules/jest-util/build/createDirectory.js +71 -0
- package/sdk-test-utilities/node_modules/jest-util/build/createProcessObject.js +109 -0
- package/sdk-test-utilities/node_modules/jest-util/build/deepCyclicCopy.js +76 -0
- package/sdk-test-utilities/node_modules/jest-util/build/formatTime.js +24 -0
- package/sdk-test-utilities/node_modules/jest-util/build/globsToMatcher.js +98 -0
- package/sdk-test-utilities/node_modules/jest-util/build/index.d.ts +136 -0
- package/sdk-test-utilities/node_modules/jest-util/build/index.js +199 -0
- package/sdk-test-utilities/node_modules/jest-util/build/installCommonGlobals.js +115 -0
- package/sdk-test-utilities/node_modules/jest-util/build/interopRequireDefault.js +22 -0
- package/sdk-test-utilities/node_modules/jest-util/build/invariant.js +18 -0
- package/sdk-test-utilities/node_modules/jest-util/build/isInteractive.js +22 -0
- package/sdk-test-utilities/node_modules/jest-util/build/isNonNullable.js +16 -0
- package/sdk-test-utilities/node_modules/jest-util/build/isPromise.js +20 -0
- package/sdk-test-utilities/node_modules/jest-util/build/pluralize.js +16 -0
- package/sdk-test-utilities/node_modules/jest-util/build/preRunMessage.js +38 -0
- package/sdk-test-utilities/node_modules/jest-util/build/replacePathSepForGlob.js +16 -0
- package/sdk-test-utilities/node_modules/jest-util/build/requireOrImportModule.js +77 -0
- package/sdk-test-utilities/node_modules/jest-util/build/setGlobal.js +17 -0
- package/sdk-test-utilities/node_modules/jest-util/build/specialChars.js +25 -0
- package/sdk-test-utilities/node_modules/jest-util/build/testPathPatternToRegExp.js +19 -0
- package/sdk-test-utilities/node_modules/jest-util/build/tryRealpath.js +30 -0
- package/sdk-test-utilities/node_modules/jest-util/package.json +38 -0
- package/sdk-test-utilities/node_modules/js-tokens/CHANGELOG.md +151 -0
- package/sdk-test-utilities/node_modules/js-tokens/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/js-tokens/README.md +240 -0
- package/sdk-test-utilities/node_modules/js-tokens/index.js +23 -0
- package/sdk-test-utilities/node_modules/js-tokens/package.json +30 -0
- package/sdk-test-utilities/node_modules/micromatch/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/micromatch/README.md +1017 -0
- package/sdk-test-utilities/node_modules/micromatch/index.js +467 -0
- package/sdk-test-utilities/node_modules/micromatch/package.json +101 -0
- package/sdk-test-utilities/node_modules/picocolors/LICENSE +15 -0
- package/sdk-test-utilities/node_modules/picocolors/README.md +21 -0
- package/sdk-test-utilities/node_modules/picocolors/package.json +25 -0
- package/sdk-test-utilities/node_modules/picocolors/picocolors.browser.js +4 -0
- package/sdk-test-utilities/node_modules/picocolors/picocolors.d.ts +5 -0
- package/sdk-test-utilities/node_modules/picocolors/picocolors.js +65 -0
- package/sdk-test-utilities/node_modules/picomatch/CHANGELOG.md +136 -0
- package/sdk-test-utilities/node_modules/picomatch/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/picomatch/README.md +708 -0
- package/sdk-test-utilities/node_modules/picomatch/index.js +3 -0
- package/sdk-test-utilities/node_modules/picomatch/lib/constants.js +179 -0
- package/sdk-test-utilities/node_modules/picomatch/lib/parse.js +1091 -0
- package/sdk-test-utilities/node_modules/picomatch/lib/picomatch.js +342 -0
- package/sdk-test-utilities/node_modules/picomatch/lib/scan.js +391 -0
- package/sdk-test-utilities/node_modules/picomatch/lib/utils.js +64 -0
- package/sdk-test-utilities/node_modules/picomatch/package.json +81 -0
- package/sdk-test-utilities/node_modules/pretty-format/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/pretty-format/README.md +463 -0
- package/sdk-test-utilities/node_modules/pretty-format/build/collections.js +180 -0
- package/sdk-test-utilities/node_modules/pretty-format/build/index.d.ts +163 -0
- package/sdk-test-utilities/node_modules/pretty-format/build/index.js +478 -0
- package/sdk-test-utilities/node_modules/pretty-format/build/plugins/AsymmetricMatcher.js +89 -0
- package/sdk-test-utilities/node_modules/pretty-format/build/plugins/DOMCollection.js +67 -0
- package/sdk-test-utilities/node_modules/pretty-format/build/plugins/DOMElement.js +101 -0
- package/sdk-test-utilities/node_modules/pretty-format/build/plugins/Immutable.js +217 -0
- package/sdk-test-utilities/node_modules/pretty-format/build/plugins/ReactElement.js +143 -0
- package/sdk-test-utilities/node_modules/pretty-format/build/plugins/ReactTestComponent.js +66 -0
- package/sdk-test-utilities/node_modules/pretty-format/build/plugins/lib/escapeHTML.js +16 -0
- package/sdk-test-utilities/node_modules/pretty-format/build/plugins/lib/markup.js +113 -0
- package/sdk-test-utilities/node_modules/pretty-format/build/types.js +1 -0
- package/sdk-test-utilities/node_modules/pretty-format/node_modules/ansi-styles/index.d.ts +167 -0
- package/sdk-test-utilities/node_modules/pretty-format/node_modules/ansi-styles/index.js +164 -0
- package/sdk-test-utilities/node_modules/pretty-format/node_modules/ansi-styles/license +9 -0
- package/sdk-test-utilities/node_modules/pretty-format/node_modules/ansi-styles/package.json +52 -0
- package/sdk-test-utilities/node_modules/pretty-format/node_modules/ansi-styles/readme.md +144 -0
- package/sdk-test-utilities/node_modules/pretty-format/package.json +43 -0
- package/sdk-test-utilities/node_modules/react-is/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/react-is/README.md +104 -0
- package/sdk-test-utilities/node_modules/react-is/cjs/react-is.development.js +221 -0
- package/sdk-test-utilities/node_modules/react-is/cjs/react-is.production.min.js +14 -0
- package/sdk-test-utilities/node_modules/react-is/index.js +7 -0
- package/sdk-test-utilities/node_modules/react-is/package.json +26 -0
- package/sdk-test-utilities/node_modules/react-is/umd/react-is.development.js +220 -0
- package/sdk-test-utilities/node_modules/react-is/umd/react-is.production.min.js +15 -0
- package/sdk-test-utilities/node_modules/slash/index.d.ts +25 -0
- package/sdk-test-utilities/node_modules/slash/index.js +11 -0
- package/sdk-test-utilities/node_modules/slash/license +9 -0
- package/sdk-test-utilities/node_modules/slash/package.json +35 -0
- package/sdk-test-utilities/node_modules/slash/readme.md +44 -0
- package/sdk-test-utilities/node_modules/stack-utils/LICENSE.md +21 -0
- package/sdk-test-utilities/node_modules/stack-utils/index.js +344 -0
- package/sdk-test-utilities/node_modules/stack-utils/package.json +39 -0
- package/sdk-test-utilities/node_modules/stack-utils/readme.md +143 -0
- package/sdk-test-utilities/node_modules/supports-color/browser.js +5 -0
- package/sdk-test-utilities/node_modules/supports-color/index.js +135 -0
- package/sdk-test-utilities/node_modules/supports-color/license +9 -0
- package/sdk-test-utilities/node_modules/supports-color/package.json +53 -0
- package/sdk-test-utilities/node_modules/supports-color/readme.md +76 -0
- package/sdk-test-utilities/node_modules/to-regex-range/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/to-regex-range/README.md +305 -0
- package/sdk-test-utilities/node_modules/to-regex-range/index.js +288 -0
- package/sdk-test-utilities/node_modules/to-regex-range/package.json +88 -0
- package/sdk-test-utilities/node_modules/undici-types/README.md +6 -0
- package/sdk-test-utilities/node_modules/undici-types/agent.d.ts +31 -0
- package/sdk-test-utilities/node_modules/undici-types/api.d.ts +43 -0
- package/sdk-test-utilities/node_modules/undici-types/balanced-pool.d.ts +18 -0
- package/sdk-test-utilities/node_modules/undici-types/cache.d.ts +36 -0
- package/sdk-test-utilities/node_modules/undici-types/client.d.ts +97 -0
- package/sdk-test-utilities/node_modules/undici-types/connector.d.ts +34 -0
- package/sdk-test-utilities/node_modules/undici-types/content-type.d.ts +21 -0
- package/sdk-test-utilities/node_modules/undici-types/cookies.d.ts +28 -0
- package/sdk-test-utilities/node_modules/undici-types/diagnostics-channel.d.ts +67 -0
- package/sdk-test-utilities/node_modules/undici-types/dispatcher.d.ts +241 -0
- package/sdk-test-utilities/node_modules/undici-types/errors.d.ts +128 -0
- package/sdk-test-utilities/node_modules/undici-types/fetch.d.ts +209 -0
- package/sdk-test-utilities/node_modules/undici-types/file.d.ts +39 -0
- package/sdk-test-utilities/node_modules/undici-types/filereader.d.ts +54 -0
- package/sdk-test-utilities/node_modules/undici-types/formdata.d.ts +108 -0
- package/sdk-test-utilities/node_modules/undici-types/global-dispatcher.d.ts +9 -0
- package/sdk-test-utilities/node_modules/undici-types/global-origin.d.ts +7 -0
- package/sdk-test-utilities/node_modules/undici-types/handlers.d.ts +9 -0
- package/sdk-test-utilities/node_modules/undici-types/header.d.ts +4 -0
- package/sdk-test-utilities/node_modules/undici-types/index.d.ts +63 -0
- package/sdk-test-utilities/node_modules/undici-types/interceptors.d.ts +5 -0
- package/sdk-test-utilities/node_modules/undici-types/mock-agent.d.ts +50 -0
- package/sdk-test-utilities/node_modules/undici-types/mock-client.d.ts +25 -0
- package/sdk-test-utilities/node_modules/undici-types/mock-errors.d.ts +12 -0
- package/sdk-test-utilities/node_modules/undici-types/mock-interceptor.d.ts +93 -0
- package/sdk-test-utilities/node_modules/undici-types/mock-pool.d.ts +25 -0
- package/sdk-test-utilities/node_modules/undici-types/package.json +55 -0
- package/sdk-test-utilities/node_modules/undici-types/patch.d.ts +71 -0
- package/sdk-test-utilities/node_modules/undici-types/pool-stats.d.ts +19 -0
- package/sdk-test-utilities/node_modules/undici-types/pool.d.ts +28 -0
- package/sdk-test-utilities/node_modules/undici-types/proxy-agent.d.ts +30 -0
- package/sdk-test-utilities/node_modules/undici-types/readable.d.ts +61 -0
- package/sdk-test-utilities/node_modules/undici-types/webidl.d.ts +220 -0
- package/sdk-test-utilities/node_modules/undici-types/websocket.d.ts +131 -0
|
@@ -0,0 +1,542 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.printReceived =
|
|
7
|
+
exports.printExpected =
|
|
8
|
+
exports.printDiffOrStringify =
|
|
9
|
+
exports.pluralize =
|
|
10
|
+
exports.matcherHint =
|
|
11
|
+
exports.matcherErrorMessage =
|
|
12
|
+
exports.highlightTrailingWhitespace =
|
|
13
|
+
exports.getLabelPrinter =
|
|
14
|
+
exports.ensureNumbers =
|
|
15
|
+
exports.ensureNoExpected =
|
|
16
|
+
exports.ensureExpectedIsNumber =
|
|
17
|
+
exports.ensureExpectedIsNonNegativeInteger =
|
|
18
|
+
exports.ensureActualIsNumber =
|
|
19
|
+
exports.diff =
|
|
20
|
+
exports.SUGGEST_TO_CONTAIN_EQUAL =
|
|
21
|
+
exports.RECEIVED_COLOR =
|
|
22
|
+
exports.INVERTED_COLOR =
|
|
23
|
+
exports.EXPECTED_COLOR =
|
|
24
|
+
exports.DIM_COLOR =
|
|
25
|
+
exports.BOLD_WEIGHT =
|
|
26
|
+
void 0;
|
|
27
|
+
exports.printWithType = printWithType;
|
|
28
|
+
exports.replaceMatchedToAsymmetricMatcher = replaceMatchedToAsymmetricMatcher;
|
|
29
|
+
exports.stringify = void 0;
|
|
30
|
+
var _chalk = _interopRequireDefault(require('chalk'));
|
|
31
|
+
var _jestDiff = require('jest-diff');
|
|
32
|
+
var _jestGetType = require('jest-get-type');
|
|
33
|
+
var _prettyFormat = require('pretty-format');
|
|
34
|
+
var _Replaceable = _interopRequireDefault(require('./Replaceable'));
|
|
35
|
+
var _deepCyclicCopyReplaceable = _interopRequireDefault(
|
|
36
|
+
require('./deepCyclicCopyReplaceable')
|
|
37
|
+
);
|
|
38
|
+
function _interopRequireDefault(obj) {
|
|
39
|
+
return obj && obj.__esModule ? obj : {default: obj};
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
43
|
+
*
|
|
44
|
+
* This source code is licensed under the MIT license found in the
|
|
45
|
+
* LICENSE file in the root directory of this source tree.
|
|
46
|
+
*/
|
|
47
|
+
|
|
48
|
+
/* eslint-disable local/ban-types-eventually */
|
|
49
|
+
|
|
50
|
+
const {
|
|
51
|
+
AsymmetricMatcher,
|
|
52
|
+
DOMCollection,
|
|
53
|
+
DOMElement,
|
|
54
|
+
Immutable,
|
|
55
|
+
ReactElement,
|
|
56
|
+
ReactTestComponent
|
|
57
|
+
} = _prettyFormat.plugins;
|
|
58
|
+
const PLUGINS = [
|
|
59
|
+
ReactTestComponent,
|
|
60
|
+
ReactElement,
|
|
61
|
+
DOMElement,
|
|
62
|
+
DOMCollection,
|
|
63
|
+
Immutable,
|
|
64
|
+
AsymmetricMatcher
|
|
65
|
+
];
|
|
66
|
+
|
|
67
|
+
// subset of Chalk type
|
|
68
|
+
|
|
69
|
+
const EXPECTED_COLOR = _chalk.default.green;
|
|
70
|
+
exports.EXPECTED_COLOR = EXPECTED_COLOR;
|
|
71
|
+
const RECEIVED_COLOR = _chalk.default.red;
|
|
72
|
+
exports.RECEIVED_COLOR = RECEIVED_COLOR;
|
|
73
|
+
const INVERTED_COLOR = _chalk.default.inverse;
|
|
74
|
+
exports.INVERTED_COLOR = INVERTED_COLOR;
|
|
75
|
+
const BOLD_WEIGHT = _chalk.default.bold;
|
|
76
|
+
exports.BOLD_WEIGHT = BOLD_WEIGHT;
|
|
77
|
+
const DIM_COLOR = _chalk.default.dim;
|
|
78
|
+
exports.DIM_COLOR = DIM_COLOR;
|
|
79
|
+
const MULTILINE_REGEXP = /\n/;
|
|
80
|
+
const SPACE_SYMBOL = '\u{00B7}'; // middle dot
|
|
81
|
+
|
|
82
|
+
const NUMBERS = [
|
|
83
|
+
'zero',
|
|
84
|
+
'one',
|
|
85
|
+
'two',
|
|
86
|
+
'three',
|
|
87
|
+
'four',
|
|
88
|
+
'five',
|
|
89
|
+
'six',
|
|
90
|
+
'seven',
|
|
91
|
+
'eight',
|
|
92
|
+
'nine',
|
|
93
|
+
'ten',
|
|
94
|
+
'eleven',
|
|
95
|
+
'twelve',
|
|
96
|
+
'thirteen'
|
|
97
|
+
];
|
|
98
|
+
const SUGGEST_TO_CONTAIN_EQUAL = _chalk.default.dim(
|
|
99
|
+
'Looks like you wanted to test for object/array equality with the stricter `toContain` matcher. You probably need to use `toContainEqual` instead.'
|
|
100
|
+
);
|
|
101
|
+
exports.SUGGEST_TO_CONTAIN_EQUAL = SUGGEST_TO_CONTAIN_EQUAL;
|
|
102
|
+
const stringify = (object, maxDepth = 10, maxWidth = 10) => {
|
|
103
|
+
const MAX_LENGTH = 10000;
|
|
104
|
+
let result;
|
|
105
|
+
try {
|
|
106
|
+
result = (0, _prettyFormat.format)(object, {
|
|
107
|
+
maxDepth,
|
|
108
|
+
maxWidth,
|
|
109
|
+
min: true,
|
|
110
|
+
plugins: PLUGINS
|
|
111
|
+
});
|
|
112
|
+
} catch {
|
|
113
|
+
result = (0, _prettyFormat.format)(object, {
|
|
114
|
+
callToJSON: false,
|
|
115
|
+
maxDepth,
|
|
116
|
+
maxWidth,
|
|
117
|
+
min: true,
|
|
118
|
+
plugins: PLUGINS
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
if (result.length >= MAX_LENGTH && maxDepth > 1) {
|
|
122
|
+
return stringify(object, Math.floor(maxDepth / 2), maxWidth);
|
|
123
|
+
} else if (result.length >= MAX_LENGTH && maxWidth > 1) {
|
|
124
|
+
return stringify(object, maxDepth, Math.floor(maxWidth / 2));
|
|
125
|
+
} else {
|
|
126
|
+
return result;
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
exports.stringify = stringify;
|
|
130
|
+
const highlightTrailingWhitespace = text =>
|
|
131
|
+
text.replace(/\s+$/gm, _chalk.default.inverse('$&'));
|
|
132
|
+
|
|
133
|
+
// Instead of inverse highlight which now implies a change,
|
|
134
|
+
// replace common spaces with middle dot at the end of any line.
|
|
135
|
+
exports.highlightTrailingWhitespace = highlightTrailingWhitespace;
|
|
136
|
+
const replaceTrailingSpaces = text =>
|
|
137
|
+
text.replace(/\s+$/gm, spaces => SPACE_SYMBOL.repeat(spaces.length));
|
|
138
|
+
const printReceived = object =>
|
|
139
|
+
RECEIVED_COLOR(replaceTrailingSpaces(stringify(object)));
|
|
140
|
+
exports.printReceived = printReceived;
|
|
141
|
+
const printExpected = value =>
|
|
142
|
+
EXPECTED_COLOR(replaceTrailingSpaces(stringify(value)));
|
|
143
|
+
exports.printExpected = printExpected;
|
|
144
|
+
function printWithType(name, value, print) {
|
|
145
|
+
const type = (0, _jestGetType.getType)(value);
|
|
146
|
+
const hasType =
|
|
147
|
+
type !== 'null' && type !== 'undefined'
|
|
148
|
+
? `${name} has type: ${type}\n`
|
|
149
|
+
: '';
|
|
150
|
+
const hasValue = `${name} has value: ${print(value)}`;
|
|
151
|
+
return hasType + hasValue;
|
|
152
|
+
}
|
|
153
|
+
const ensureNoExpected = (expected, matcherName, options) => {
|
|
154
|
+
if (typeof expected !== 'undefined') {
|
|
155
|
+
// Prepend maybe not only for backward compatibility.
|
|
156
|
+
const matcherString = (options ? '' : '[.not]') + matcherName;
|
|
157
|
+
throw new Error(
|
|
158
|
+
matcherErrorMessage(
|
|
159
|
+
matcherHint(matcherString, undefined, '', options),
|
|
160
|
+
// Because expected is omitted in hint above,
|
|
161
|
+
// expected is black instead of green in message below.
|
|
162
|
+
'this matcher must not have an expected argument',
|
|
163
|
+
printWithType('Expected', expected, printExpected)
|
|
164
|
+
)
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Ensures that `actual` is of type `number | bigint`
|
|
171
|
+
*/
|
|
172
|
+
exports.ensureNoExpected = ensureNoExpected;
|
|
173
|
+
const ensureActualIsNumber = (actual, matcherName, options) => {
|
|
174
|
+
if (typeof actual !== 'number' && typeof actual !== 'bigint') {
|
|
175
|
+
// Prepend maybe not only for backward compatibility.
|
|
176
|
+
const matcherString = (options ? '' : '[.not]') + matcherName;
|
|
177
|
+
throw new Error(
|
|
178
|
+
matcherErrorMessage(
|
|
179
|
+
matcherHint(matcherString, undefined, undefined, options),
|
|
180
|
+
`${RECEIVED_COLOR('received')} value must be a number or bigint`,
|
|
181
|
+
printWithType('Received', actual, printReceived)
|
|
182
|
+
)
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Ensures that `expected` is of type `number | bigint`
|
|
189
|
+
*/
|
|
190
|
+
exports.ensureActualIsNumber = ensureActualIsNumber;
|
|
191
|
+
const ensureExpectedIsNumber = (expected, matcherName, options) => {
|
|
192
|
+
if (typeof expected !== 'number' && typeof expected !== 'bigint') {
|
|
193
|
+
// Prepend maybe not only for backward compatibility.
|
|
194
|
+
const matcherString = (options ? '' : '[.not]') + matcherName;
|
|
195
|
+
throw new Error(
|
|
196
|
+
matcherErrorMessage(
|
|
197
|
+
matcherHint(matcherString, undefined, undefined, options),
|
|
198
|
+
`${EXPECTED_COLOR('expected')} value must be a number or bigint`,
|
|
199
|
+
printWithType('Expected', expected, printExpected)
|
|
200
|
+
)
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Ensures that `actual` & `expected` are of type `number | bigint`
|
|
207
|
+
*/
|
|
208
|
+
exports.ensureExpectedIsNumber = ensureExpectedIsNumber;
|
|
209
|
+
const ensureNumbers = (actual, expected, matcherName, options) => {
|
|
210
|
+
ensureActualIsNumber(actual, matcherName, options);
|
|
211
|
+
ensureExpectedIsNumber(expected, matcherName, options);
|
|
212
|
+
};
|
|
213
|
+
exports.ensureNumbers = ensureNumbers;
|
|
214
|
+
const ensureExpectedIsNonNegativeInteger = (expected, matcherName, options) => {
|
|
215
|
+
if (
|
|
216
|
+
typeof expected !== 'number' ||
|
|
217
|
+
!Number.isSafeInteger(expected) ||
|
|
218
|
+
expected < 0
|
|
219
|
+
) {
|
|
220
|
+
// Prepend maybe not only for backward compatibility.
|
|
221
|
+
const matcherString = (options ? '' : '[.not]') + matcherName;
|
|
222
|
+
throw new Error(
|
|
223
|
+
matcherErrorMessage(
|
|
224
|
+
matcherHint(matcherString, undefined, undefined, options),
|
|
225
|
+
`${EXPECTED_COLOR('expected')} value must be a non-negative integer`,
|
|
226
|
+
printWithType('Expected', expected, printExpected)
|
|
227
|
+
)
|
|
228
|
+
);
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
// Given array of diffs, return concatenated string:
|
|
233
|
+
// * include common substrings
|
|
234
|
+
// * exclude change substrings which have opposite op
|
|
235
|
+
// * include change substrings which have argument op
|
|
236
|
+
// with inverse highlight only if there is a common substring
|
|
237
|
+
exports.ensureExpectedIsNonNegativeInteger = ensureExpectedIsNonNegativeInteger;
|
|
238
|
+
const getCommonAndChangedSubstrings = (diffs, op, hasCommonDiff) =>
|
|
239
|
+
diffs.reduce(
|
|
240
|
+
(reduced, diff) =>
|
|
241
|
+
reduced +
|
|
242
|
+
(diff[0] === _jestDiff.DIFF_EQUAL
|
|
243
|
+
? diff[1]
|
|
244
|
+
: diff[0] !== op
|
|
245
|
+
? ''
|
|
246
|
+
: hasCommonDiff
|
|
247
|
+
? INVERTED_COLOR(diff[1])
|
|
248
|
+
: diff[1]),
|
|
249
|
+
''
|
|
250
|
+
);
|
|
251
|
+
const isLineDiffable = (expected, received) => {
|
|
252
|
+
const expectedType = (0, _jestGetType.getType)(expected);
|
|
253
|
+
const receivedType = (0, _jestGetType.getType)(received);
|
|
254
|
+
if (expectedType !== receivedType) {
|
|
255
|
+
return false;
|
|
256
|
+
}
|
|
257
|
+
if ((0, _jestGetType.isPrimitive)(expected)) {
|
|
258
|
+
// Print generic line diff for strings only:
|
|
259
|
+
// * if neither string is empty
|
|
260
|
+
// * if either string has more than one line
|
|
261
|
+
return (
|
|
262
|
+
typeof expected === 'string' &&
|
|
263
|
+
typeof received === 'string' &&
|
|
264
|
+
expected.length !== 0 &&
|
|
265
|
+
received.length !== 0 &&
|
|
266
|
+
(MULTILINE_REGEXP.test(expected) || MULTILINE_REGEXP.test(received))
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
if (
|
|
270
|
+
expectedType === 'date' ||
|
|
271
|
+
expectedType === 'function' ||
|
|
272
|
+
expectedType === 'regexp'
|
|
273
|
+
) {
|
|
274
|
+
return false;
|
|
275
|
+
}
|
|
276
|
+
if (expected instanceof Error && received instanceof Error) {
|
|
277
|
+
return false;
|
|
278
|
+
}
|
|
279
|
+
if (
|
|
280
|
+
receivedType === 'object' &&
|
|
281
|
+
typeof received.asymmetricMatch === 'function'
|
|
282
|
+
) {
|
|
283
|
+
return false;
|
|
284
|
+
}
|
|
285
|
+
return true;
|
|
286
|
+
};
|
|
287
|
+
const MAX_DIFF_STRING_LENGTH = 20000;
|
|
288
|
+
const printDiffOrStringify = (
|
|
289
|
+
expected,
|
|
290
|
+
received,
|
|
291
|
+
expectedLabel,
|
|
292
|
+
receivedLabel,
|
|
293
|
+
expand // CLI options: true if `--expand` or false if `--no-expand`
|
|
294
|
+
) => {
|
|
295
|
+
if (
|
|
296
|
+
typeof expected === 'string' &&
|
|
297
|
+
typeof received === 'string' &&
|
|
298
|
+
expected.length !== 0 &&
|
|
299
|
+
received.length !== 0 &&
|
|
300
|
+
expected.length <= MAX_DIFF_STRING_LENGTH &&
|
|
301
|
+
received.length <= MAX_DIFF_STRING_LENGTH &&
|
|
302
|
+
expected !== received
|
|
303
|
+
) {
|
|
304
|
+
if (expected.includes('\n') || received.includes('\n')) {
|
|
305
|
+
return (0, _jestDiff.diffStringsUnified)(expected, received, {
|
|
306
|
+
aAnnotation: expectedLabel,
|
|
307
|
+
bAnnotation: receivedLabel,
|
|
308
|
+
changeLineTrailingSpaceColor: _chalk.default.bgYellow,
|
|
309
|
+
commonLineTrailingSpaceColor: _chalk.default.bgYellow,
|
|
310
|
+
emptyFirstOrLastLinePlaceholder: '↵',
|
|
311
|
+
// U+21B5
|
|
312
|
+
expand,
|
|
313
|
+
includeChangeCounts: true
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
const diffs = (0, _jestDiff.diffStringsRaw)(expected, received, true);
|
|
317
|
+
const hasCommonDiff = diffs.some(diff => diff[0] === _jestDiff.DIFF_EQUAL);
|
|
318
|
+
const printLabel = getLabelPrinter(expectedLabel, receivedLabel);
|
|
319
|
+
const expectedLine =
|
|
320
|
+
printLabel(expectedLabel) +
|
|
321
|
+
printExpected(
|
|
322
|
+
getCommonAndChangedSubstrings(
|
|
323
|
+
diffs,
|
|
324
|
+
_jestDiff.DIFF_DELETE,
|
|
325
|
+
hasCommonDiff
|
|
326
|
+
)
|
|
327
|
+
);
|
|
328
|
+
const receivedLine =
|
|
329
|
+
printLabel(receivedLabel) +
|
|
330
|
+
printReceived(
|
|
331
|
+
getCommonAndChangedSubstrings(
|
|
332
|
+
diffs,
|
|
333
|
+
_jestDiff.DIFF_INSERT,
|
|
334
|
+
hasCommonDiff
|
|
335
|
+
)
|
|
336
|
+
);
|
|
337
|
+
return `${expectedLine}\n${receivedLine}`;
|
|
338
|
+
}
|
|
339
|
+
if (isLineDiffable(expected, received)) {
|
|
340
|
+
const {replacedExpected, replacedReceived} =
|
|
341
|
+
replaceMatchedToAsymmetricMatcher(expected, received, [], []);
|
|
342
|
+
const difference = (0, _jestDiff.diff)(replacedExpected, replacedReceived, {
|
|
343
|
+
aAnnotation: expectedLabel,
|
|
344
|
+
bAnnotation: receivedLabel,
|
|
345
|
+
expand,
|
|
346
|
+
includeChangeCounts: true
|
|
347
|
+
});
|
|
348
|
+
if (
|
|
349
|
+
typeof difference === 'string' &&
|
|
350
|
+
difference.includes(`- ${expectedLabel}`) &&
|
|
351
|
+
difference.includes(`+ ${receivedLabel}`)
|
|
352
|
+
) {
|
|
353
|
+
return difference;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
const printLabel = getLabelPrinter(expectedLabel, receivedLabel);
|
|
357
|
+
const expectedLine = printLabel(expectedLabel) + printExpected(expected);
|
|
358
|
+
const receivedLine =
|
|
359
|
+
printLabel(receivedLabel) +
|
|
360
|
+
(stringify(expected) === stringify(received)
|
|
361
|
+
? 'serializes to the same string'
|
|
362
|
+
: printReceived(received));
|
|
363
|
+
return `${expectedLine}\n${receivedLine}`;
|
|
364
|
+
};
|
|
365
|
+
|
|
366
|
+
// Sometimes, e.g. when comparing two numbers, the output from jest-diff
|
|
367
|
+
// does not contain more information than the `Expected:` / `Received:` already gives.
|
|
368
|
+
// In those cases, we do not print a diff to make the output shorter and not redundant.
|
|
369
|
+
exports.printDiffOrStringify = printDiffOrStringify;
|
|
370
|
+
const shouldPrintDiff = (actual, expected) => {
|
|
371
|
+
if (typeof actual === 'number' && typeof expected === 'number') {
|
|
372
|
+
return false;
|
|
373
|
+
}
|
|
374
|
+
if (typeof actual === 'bigint' && typeof expected === 'bigint') {
|
|
375
|
+
return false;
|
|
376
|
+
}
|
|
377
|
+
if (typeof actual === 'boolean' && typeof expected === 'boolean') {
|
|
378
|
+
return false;
|
|
379
|
+
}
|
|
380
|
+
return true;
|
|
381
|
+
};
|
|
382
|
+
function replaceMatchedToAsymmetricMatcher(
|
|
383
|
+
replacedExpected,
|
|
384
|
+
replacedReceived,
|
|
385
|
+
expectedCycles,
|
|
386
|
+
receivedCycles
|
|
387
|
+
) {
|
|
388
|
+
return _replaceMatchedToAsymmetricMatcher(
|
|
389
|
+
(0, _deepCyclicCopyReplaceable.default)(replacedExpected),
|
|
390
|
+
(0, _deepCyclicCopyReplaceable.default)(replacedReceived),
|
|
391
|
+
expectedCycles,
|
|
392
|
+
receivedCycles
|
|
393
|
+
);
|
|
394
|
+
}
|
|
395
|
+
function _replaceMatchedToAsymmetricMatcher(
|
|
396
|
+
replacedExpected,
|
|
397
|
+
replacedReceived,
|
|
398
|
+
expectedCycles,
|
|
399
|
+
receivedCycles
|
|
400
|
+
) {
|
|
401
|
+
if (!_Replaceable.default.isReplaceable(replacedExpected, replacedReceived)) {
|
|
402
|
+
return {
|
|
403
|
+
replacedExpected,
|
|
404
|
+
replacedReceived
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
if (
|
|
408
|
+
expectedCycles.includes(replacedExpected) ||
|
|
409
|
+
receivedCycles.includes(replacedReceived)
|
|
410
|
+
) {
|
|
411
|
+
return {
|
|
412
|
+
replacedExpected,
|
|
413
|
+
replacedReceived
|
|
414
|
+
};
|
|
415
|
+
}
|
|
416
|
+
expectedCycles.push(replacedExpected);
|
|
417
|
+
receivedCycles.push(replacedReceived);
|
|
418
|
+
const expectedReplaceable = new _Replaceable.default(replacedExpected);
|
|
419
|
+
const receivedReplaceable = new _Replaceable.default(replacedReceived);
|
|
420
|
+
expectedReplaceable.forEach((expectedValue, key) => {
|
|
421
|
+
const receivedValue = receivedReplaceable.get(key);
|
|
422
|
+
if (isAsymmetricMatcher(expectedValue)) {
|
|
423
|
+
if (expectedValue.asymmetricMatch(receivedValue)) {
|
|
424
|
+
receivedReplaceable.set(key, expectedValue);
|
|
425
|
+
}
|
|
426
|
+
} else if (isAsymmetricMatcher(receivedValue)) {
|
|
427
|
+
if (receivedValue.asymmetricMatch(expectedValue)) {
|
|
428
|
+
expectedReplaceable.set(key, receivedValue);
|
|
429
|
+
}
|
|
430
|
+
} else if (
|
|
431
|
+
_Replaceable.default.isReplaceable(expectedValue, receivedValue)
|
|
432
|
+
) {
|
|
433
|
+
const replaced = _replaceMatchedToAsymmetricMatcher(
|
|
434
|
+
expectedValue,
|
|
435
|
+
receivedValue,
|
|
436
|
+
expectedCycles,
|
|
437
|
+
receivedCycles
|
|
438
|
+
);
|
|
439
|
+
expectedReplaceable.set(key, replaced.replacedExpected);
|
|
440
|
+
receivedReplaceable.set(key, replaced.replacedReceived);
|
|
441
|
+
}
|
|
442
|
+
});
|
|
443
|
+
return {
|
|
444
|
+
replacedExpected: expectedReplaceable.object,
|
|
445
|
+
replacedReceived: receivedReplaceable.object
|
|
446
|
+
};
|
|
447
|
+
}
|
|
448
|
+
function isAsymmetricMatcher(data) {
|
|
449
|
+
const type = (0, _jestGetType.getType)(data);
|
|
450
|
+
return type === 'object' && typeof data.asymmetricMatch === 'function';
|
|
451
|
+
}
|
|
452
|
+
const diff = (a, b, options) =>
|
|
453
|
+
shouldPrintDiff(a, b) ? (0, _jestDiff.diff)(a, b, options) : null;
|
|
454
|
+
exports.diff = diff;
|
|
455
|
+
const pluralize = (word, count) =>
|
|
456
|
+
`${NUMBERS[count] || count} ${word}${count === 1 ? '' : 's'}`;
|
|
457
|
+
|
|
458
|
+
// To display lines of labeled values as two columns with monospace alignment:
|
|
459
|
+
// given the strings which will describe the values,
|
|
460
|
+
// return function which given each string, returns the label:
|
|
461
|
+
// string, colon, space, and enough padding spaces to align the value.
|
|
462
|
+
exports.pluralize = pluralize;
|
|
463
|
+
const getLabelPrinter = (...strings) => {
|
|
464
|
+
const maxLength = strings.reduce(
|
|
465
|
+
(max, string) => (string.length > max ? string.length : max),
|
|
466
|
+
0
|
|
467
|
+
);
|
|
468
|
+
return string => `${string}: ${' '.repeat(maxLength - string.length)}`;
|
|
469
|
+
};
|
|
470
|
+
exports.getLabelPrinter = getLabelPrinter;
|
|
471
|
+
const matcherErrorMessage = (
|
|
472
|
+
hint,
|
|
473
|
+
generic,
|
|
474
|
+
specific // incorrect value returned from call to printWithType
|
|
475
|
+
) =>
|
|
476
|
+
`${hint}\n\n${_chalk.default.bold('Matcher error')}: ${generic}${
|
|
477
|
+
typeof specific === 'string' ? `\n\n${specific}` : ''
|
|
478
|
+
}`;
|
|
479
|
+
|
|
480
|
+
// Display assertion for the report when a test fails.
|
|
481
|
+
// New format: rejects/resolves, not, and matcher name have black color
|
|
482
|
+
// Old format: matcher name has dim color
|
|
483
|
+
exports.matcherErrorMessage = matcherErrorMessage;
|
|
484
|
+
const matcherHint = (
|
|
485
|
+
matcherName,
|
|
486
|
+
received = 'received',
|
|
487
|
+
expected = 'expected',
|
|
488
|
+
options = {}
|
|
489
|
+
) => {
|
|
490
|
+
const {
|
|
491
|
+
comment = '',
|
|
492
|
+
expectedColor = EXPECTED_COLOR,
|
|
493
|
+
isDirectExpectCall = false,
|
|
494
|
+
// seems redundant with received === ''
|
|
495
|
+
isNot = false,
|
|
496
|
+
promise = '',
|
|
497
|
+
receivedColor = RECEIVED_COLOR,
|
|
498
|
+
secondArgument = '',
|
|
499
|
+
secondArgumentColor = EXPECTED_COLOR
|
|
500
|
+
} = options;
|
|
501
|
+
let hint = '';
|
|
502
|
+
let dimString = 'expect'; // concatenate adjacent dim substrings
|
|
503
|
+
|
|
504
|
+
if (!isDirectExpectCall && received !== '') {
|
|
505
|
+
hint += DIM_COLOR(`${dimString}(`) + receivedColor(received);
|
|
506
|
+
dimString = ')';
|
|
507
|
+
}
|
|
508
|
+
if (promise !== '') {
|
|
509
|
+
hint += DIM_COLOR(`${dimString}.`) + promise;
|
|
510
|
+
dimString = '';
|
|
511
|
+
}
|
|
512
|
+
if (isNot) {
|
|
513
|
+
hint += `${DIM_COLOR(`${dimString}.`)}not`;
|
|
514
|
+
dimString = '';
|
|
515
|
+
}
|
|
516
|
+
if (matcherName.includes('.')) {
|
|
517
|
+
// Old format: for backward compatibility,
|
|
518
|
+
// especially without promise or isNot options
|
|
519
|
+
dimString += matcherName;
|
|
520
|
+
} else {
|
|
521
|
+
// New format: omit period from matcherName arg
|
|
522
|
+
hint += DIM_COLOR(`${dimString}.`) + matcherName;
|
|
523
|
+
dimString = '';
|
|
524
|
+
}
|
|
525
|
+
if (expected === '') {
|
|
526
|
+
dimString += '()';
|
|
527
|
+
} else {
|
|
528
|
+
hint += DIM_COLOR(`${dimString}(`) + expectedColor(expected);
|
|
529
|
+
if (secondArgument) {
|
|
530
|
+
hint += DIM_COLOR(', ') + secondArgumentColor(secondArgument);
|
|
531
|
+
}
|
|
532
|
+
dimString = ')';
|
|
533
|
+
}
|
|
534
|
+
if (comment !== '') {
|
|
535
|
+
dimString += ` // ${comment}`;
|
|
536
|
+
}
|
|
537
|
+
if (dimString !== '') {
|
|
538
|
+
hint += DIM_COLOR(dimString);
|
|
539
|
+
}
|
|
540
|
+
return hint;
|
|
541
|
+
};
|
|
542
|
+
exports.matcherHint = matcherHint;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "jest-matcher-utils",
|
|
3
|
+
"description": "A set of utility functions for expect and related packages",
|
|
4
|
+
"version": "29.7.0",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/jestjs/jest.git",
|
|
8
|
+
"directory": "packages/jest-matcher-utils"
|
|
9
|
+
},
|
|
10
|
+
"engines": {
|
|
11
|
+
"node": "^14.15.0 || ^16.10.0 || >=18.0.0"
|
|
12
|
+
},
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"main": "./build/index.js",
|
|
15
|
+
"types": "./build/index.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./build/index.d.ts",
|
|
19
|
+
"default": "./build/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./package.json": "./package.json"
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"chalk": "^4.0.0",
|
|
25
|
+
"jest-diff": "^29.7.0",
|
|
26
|
+
"jest-get-type": "^29.6.3",
|
|
27
|
+
"pretty-format": "^29.7.0"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@jest/test-utils": "^29.7.0",
|
|
31
|
+
"@types/node": "*"
|
|
32
|
+
},
|
|
33
|
+
"publishConfig": {
|
|
34
|
+
"access": "public"
|
|
35
|
+
},
|
|
36
|
+
"gitHead": "4e56991693da7cd4c3730dc3579a1dd1403ee630"
|
|
37
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import type {Config} from '@jest/types';
|
|
8
|
+
import type {StackData} from 'stack-utils';
|
|
9
|
+
import type {TestResult} from '@jest/types';
|
|
10
|
+
|
|
11
|
+
export declare const formatExecError: (
|
|
12
|
+
error: Error | TestResult.SerializableError | string | number | undefined,
|
|
13
|
+
config: StackTraceConfig,
|
|
14
|
+
options: StackTraceOptions,
|
|
15
|
+
testPath?: string,
|
|
16
|
+
reuseMessage?: boolean,
|
|
17
|
+
noTitle?: boolean,
|
|
18
|
+
) => string;
|
|
19
|
+
|
|
20
|
+
export declare const formatPath: (
|
|
21
|
+
line: string,
|
|
22
|
+
config: StackTraceConfig,
|
|
23
|
+
relativeTestPath?: string | null,
|
|
24
|
+
) => string;
|
|
25
|
+
|
|
26
|
+
export declare const formatResultsErrors: (
|
|
27
|
+
testResults: Array<TestResult.AssertionResult>,
|
|
28
|
+
config: StackTraceConfig,
|
|
29
|
+
options: StackTraceOptions,
|
|
30
|
+
testPath?: string,
|
|
31
|
+
) => string | null;
|
|
32
|
+
|
|
33
|
+
export declare const formatStackTrace: (
|
|
34
|
+
stack: string,
|
|
35
|
+
config: StackTraceConfig,
|
|
36
|
+
options: StackTraceOptions,
|
|
37
|
+
testPath?: string,
|
|
38
|
+
) => string;
|
|
39
|
+
|
|
40
|
+
export declare interface Frame extends StackData {
|
|
41
|
+
file: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export declare const getStackTraceLines: (
|
|
45
|
+
stack: string,
|
|
46
|
+
options?: StackTraceOptions,
|
|
47
|
+
) => Array<string>;
|
|
48
|
+
|
|
49
|
+
export declare const getTopFrame: (lines: Array<string>) => Frame | null;
|
|
50
|
+
|
|
51
|
+
export declare const indentAllLines: (lines: string) => string;
|
|
52
|
+
|
|
53
|
+
export declare const separateMessageFromStack: (content: string) => {
|
|
54
|
+
message: string;
|
|
55
|
+
stack: string;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export declare type StackTraceConfig = Pick<
|
|
59
|
+
Config.ProjectConfig,
|
|
60
|
+
'rootDir' | 'testMatch'
|
|
61
|
+
>;
|
|
62
|
+
|
|
63
|
+
export declare type StackTraceOptions = {
|
|
64
|
+
noStackTrace: boolean;
|
|
65
|
+
noCodeFrame?: boolean;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export {};
|