ibm-cloud-sdk-core 4.3.3 → 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/iamtest.env +3 -0
- package/package.json +2 -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,463 @@
|
|
|
1
|
+
# pretty-format
|
|
2
|
+
|
|
3
|
+
Stringify any JavaScript value.
|
|
4
|
+
|
|
5
|
+
- Serialize built-in JavaScript types.
|
|
6
|
+
- Serialize application-specific data types with built-in or user-defined plugins.
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
$ yarn add pretty-format
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
```js
|
|
17
|
+
const {format: prettyFormat} = require('pretty-format'); // CommonJS
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
```js
|
|
21
|
+
import {format as prettyFormat} from 'pretty-format'; // ES2015 modules
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
const val = {object: {}};
|
|
26
|
+
val.circularReference = val;
|
|
27
|
+
val[Symbol('foo')] = 'foo';
|
|
28
|
+
val.map = new Map([['prop', 'value']]);
|
|
29
|
+
val.array = [-0, Infinity, NaN];
|
|
30
|
+
|
|
31
|
+
console.log(prettyFormat(val));
|
|
32
|
+
/*
|
|
33
|
+
Object {
|
|
34
|
+
"array": Array [
|
|
35
|
+
-0,
|
|
36
|
+
Infinity,
|
|
37
|
+
NaN,
|
|
38
|
+
],
|
|
39
|
+
"circularReference": [Circular],
|
|
40
|
+
"map": Map {
|
|
41
|
+
"prop" => "value",
|
|
42
|
+
},
|
|
43
|
+
"object": Object {},
|
|
44
|
+
Symbol(foo): "foo",
|
|
45
|
+
}
|
|
46
|
+
*/
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Usage with options
|
|
50
|
+
|
|
51
|
+
```js
|
|
52
|
+
function onClick() {}
|
|
53
|
+
|
|
54
|
+
console.log(prettyFormat(onClick));
|
|
55
|
+
/*
|
|
56
|
+
[Function onClick]
|
|
57
|
+
*/
|
|
58
|
+
|
|
59
|
+
const options = {
|
|
60
|
+
printFunctionName: false,
|
|
61
|
+
};
|
|
62
|
+
console.log(prettyFormat(onClick, options));
|
|
63
|
+
/*
|
|
64
|
+
[Function]
|
|
65
|
+
*/
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
<!-- prettier-ignore -->
|
|
69
|
+
| key | type | default | description |
|
|
70
|
+
| :-------------------- | :--------------- | :---------- | :-------------------------------------------------------------------------------------- |
|
|
71
|
+
| `callToJSON` | `boolean` | `true` | call `toJSON` method (if it exists) on objects |
|
|
72
|
+
| `compareKeys` | `function\|null` | `undefined` | compare function used when sorting object keys, `null` can be used to skip over sorting |
|
|
73
|
+
| `escapeRegex` | `boolean` | `false` | escape special characters in regular expressions |
|
|
74
|
+
| `escapeString` | `boolean` | `true` | escape special characters in strings |
|
|
75
|
+
| `highlight` | `boolean` | `false` | highlight syntax with colors in terminal (some plugins) |
|
|
76
|
+
| `indent` | `number` | `2` | spaces in each level of indentation |
|
|
77
|
+
| `maxDepth` | `number` | `Infinity` | levels to print in arrays, objects, elements, and so on |
|
|
78
|
+
| `maxWidth` | `number` | `Infinity` | number of elements to print in arrays, sets, and so on |
|
|
79
|
+
| `min` | `boolean` | `false` | minimize added space: no indentation nor line breaks |
|
|
80
|
+
| `plugins` | `array` | `[]` | plugins to serialize application-specific data types |
|
|
81
|
+
| `printBasicPrototype` | `boolean` | `false` | print the prototype for plain objects and arrays |
|
|
82
|
+
| `printFunctionName` | `boolean` | `true` | include or omit the name of a function |
|
|
83
|
+
| `theme` | `object` | | colors to highlight syntax in terminal |
|
|
84
|
+
|
|
85
|
+
Property values of `theme` are from [ansi-styles colors](https://github.com/chalk/ansi-styles#colors)
|
|
86
|
+
|
|
87
|
+
```js
|
|
88
|
+
const DEFAULT_THEME = {
|
|
89
|
+
comment: 'gray',
|
|
90
|
+
content: 'reset',
|
|
91
|
+
prop: 'yellow',
|
|
92
|
+
tag: 'cyan',
|
|
93
|
+
value: 'green',
|
|
94
|
+
};
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Usage with plugins
|
|
98
|
+
|
|
99
|
+
The `pretty-format` package provides some built-in plugins, including:
|
|
100
|
+
|
|
101
|
+
- `ReactElement` for elements from `react`
|
|
102
|
+
- `ReactTestComponent` for test objects from `react-test-renderer`
|
|
103
|
+
|
|
104
|
+
```js
|
|
105
|
+
// CommonJS
|
|
106
|
+
const React = require('react');
|
|
107
|
+
const renderer = require('react-test-renderer');
|
|
108
|
+
const {format: prettyFormat, plugins} = require('pretty-format');
|
|
109
|
+
|
|
110
|
+
const {ReactElement, ReactTestComponent} = plugins;
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
```js
|
|
114
|
+
// ES2015 modules and destructuring assignment
|
|
115
|
+
import React from 'react';
|
|
116
|
+
import renderer from 'react-test-renderer';
|
|
117
|
+
import {plugins, format as prettyFormat} from 'pretty-format';
|
|
118
|
+
|
|
119
|
+
const {ReactElement, ReactTestComponent} = plugins;
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
```js
|
|
123
|
+
const onClick = () => {};
|
|
124
|
+
const element = React.createElement('button', {onClick}, 'Hello World');
|
|
125
|
+
|
|
126
|
+
const formatted1 = prettyFormat(element, {
|
|
127
|
+
plugins: [ReactElement],
|
|
128
|
+
printFunctionName: false,
|
|
129
|
+
});
|
|
130
|
+
const formatted2 = prettyFormat(renderer.create(element).toJSON(), {
|
|
131
|
+
plugins: [ReactTestComponent],
|
|
132
|
+
printFunctionName: false,
|
|
133
|
+
});
|
|
134
|
+
/*
|
|
135
|
+
<button
|
|
136
|
+
onClick=[Function]
|
|
137
|
+
>
|
|
138
|
+
Hello World
|
|
139
|
+
</button>
|
|
140
|
+
*/
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Usage in Jest
|
|
144
|
+
|
|
145
|
+
For snapshot tests, Jest uses `pretty-format` with options that include some of its built-in plugins. For this purpose, plugins are also known as **snapshot serializers**.
|
|
146
|
+
|
|
147
|
+
To serialize application-specific data types, you can add modules to `devDependencies` of a project, and then:
|
|
148
|
+
|
|
149
|
+
In an **individual** test file, you can add a module as follows. It precedes any modules from Jest configuration.
|
|
150
|
+
|
|
151
|
+
```js
|
|
152
|
+
import serializer from 'my-serializer-module';
|
|
153
|
+
expect.addSnapshotSerializer(serializer);
|
|
154
|
+
|
|
155
|
+
// tests which have `expect(value).toMatchSnapshot()` assertions
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
For **all** test files, you can specify modules in Jest configuration. They precede built-in plugins for React, HTML, and Immutable.js data types. For example, in a `package.json` file:
|
|
159
|
+
|
|
160
|
+
```json
|
|
161
|
+
{
|
|
162
|
+
"jest": {
|
|
163
|
+
"snapshotSerializers": ["my-serializer-module"]
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
## Writing plugins
|
|
169
|
+
|
|
170
|
+
A plugin is a JavaScript object.
|
|
171
|
+
|
|
172
|
+
If `options` has a `plugins` array: for the first plugin whose `test(val)` method returns a truthy value, then `prettyFormat(val, options)` returns the result from either:
|
|
173
|
+
|
|
174
|
+
- `serialize(val, …)` method of the **improved** interface (available in **version 21** or later)
|
|
175
|
+
- `print(val, …)` method of the **original** interface (if plugin does not have `serialize` method)
|
|
176
|
+
|
|
177
|
+
### test
|
|
178
|
+
|
|
179
|
+
Write `test` so it can receive `val` argument of any type. To serialize **objects** which have certain properties, then a guarded expression like `val != null && …` or more concise `val && …` prevents the following errors:
|
|
180
|
+
|
|
181
|
+
- `TypeError: Cannot read property 'whatever' of null`
|
|
182
|
+
- `TypeError: Cannot read property 'whatever' of undefined`
|
|
183
|
+
|
|
184
|
+
For example, `test` method of built-in `ReactElement` plugin:
|
|
185
|
+
|
|
186
|
+
```js
|
|
187
|
+
const elementSymbol = Symbol.for('react.element');
|
|
188
|
+
const test = val => val && val.$$typeof === elementSymbol;
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
Pay attention to efficiency in `test` because `pretty-format` calls it often.
|
|
192
|
+
|
|
193
|
+
### serialize
|
|
194
|
+
|
|
195
|
+
The **improved** interface is available in **version 21** or later.
|
|
196
|
+
|
|
197
|
+
Write `serialize` to return a string, given the arguments:
|
|
198
|
+
|
|
199
|
+
- `val` which “passed the test”
|
|
200
|
+
- unchanging `config` object: derived from `options`
|
|
201
|
+
- current `indentation` string: concatenate to `indent` from `config`
|
|
202
|
+
- current `depth` number: compare to `maxDepth` from `config`
|
|
203
|
+
- current `refs` array: find circular references in objects
|
|
204
|
+
- `printer` callback function: serialize children
|
|
205
|
+
|
|
206
|
+
### config
|
|
207
|
+
|
|
208
|
+
<!-- prettier-ignore -->
|
|
209
|
+
| key | type | description |
|
|
210
|
+
| :------------------ | :--------------- | :-------------------------------------------------------------------------------------- |
|
|
211
|
+
| `callToJSON` | `boolean` | call `toJSON` method (if it exists) on objects |
|
|
212
|
+
| `compareKeys` | `function\|null` | compare function used when sorting object keys, `null` can be used to skip over sorting |
|
|
213
|
+
| `colors` | `Object` | escape codes for colors to highlight syntax |
|
|
214
|
+
| `escapeRegex` | `boolean` | escape special characters in regular expressions |
|
|
215
|
+
| `escapeString` | `boolean` | escape special characters in strings |
|
|
216
|
+
| `indent` | `string` | spaces in each level of indentation |
|
|
217
|
+
| `maxDepth` | `number` | levels to print in arrays, objects, elements, and so on |
|
|
218
|
+
| `min` | `boolean` | minimize added space: no indentation nor line breaks |
|
|
219
|
+
| `plugins` | `array` | plugins to serialize application-specific data types |
|
|
220
|
+
| `printFunctionName` | `boolean` | include or omit the name of a function |
|
|
221
|
+
| `spacingInner` | `string` | spacing to separate items in a list |
|
|
222
|
+
| `spacingOuter` | `string` | spacing to enclose a list of items |
|
|
223
|
+
|
|
224
|
+
Each property of `colors` in `config` corresponds to a property of `theme` in `options`:
|
|
225
|
+
|
|
226
|
+
- the key is the same (for example, `tag`)
|
|
227
|
+
- the value in `colors` is a object with `open` and `close` properties whose values are escape codes from [ansi-styles](https://github.com/chalk/ansi-styles) for the color value in `theme` (for example, `'cyan'`)
|
|
228
|
+
|
|
229
|
+
Some properties in `config` are derived from `min` in `options`:
|
|
230
|
+
|
|
231
|
+
- `spacingInner` and `spacingOuter` are **newline** if `min` is `false`
|
|
232
|
+
- `spacingInner` is **space** and `spacingOuter` is **empty string** if `min` is `true`
|
|
233
|
+
|
|
234
|
+
### Example of serialize and test
|
|
235
|
+
|
|
236
|
+
This plugin is a pattern you can apply to serialize composite data types. Side note: `pretty-format` does not need a plugin to serialize arrays.
|
|
237
|
+
|
|
238
|
+
```js
|
|
239
|
+
// We reused more code when we factored out a function for child items
|
|
240
|
+
// that is independent of depth, name, and enclosing punctuation (see below).
|
|
241
|
+
const SEPARATOR = ',';
|
|
242
|
+
function serializeItems(items, config, indentation, depth, refs, printer) {
|
|
243
|
+
if (items.length === 0) {
|
|
244
|
+
return '';
|
|
245
|
+
}
|
|
246
|
+
const indentationItems = indentation + config.indent;
|
|
247
|
+
return (
|
|
248
|
+
config.spacingOuter +
|
|
249
|
+
items
|
|
250
|
+
.map(
|
|
251
|
+
item =>
|
|
252
|
+
indentationItems +
|
|
253
|
+
printer(item, config, indentationItems, depth, refs), // callback
|
|
254
|
+
)
|
|
255
|
+
.join(SEPARATOR + config.spacingInner) +
|
|
256
|
+
(config.min ? '' : SEPARATOR) + // following the last item
|
|
257
|
+
config.spacingOuter +
|
|
258
|
+
indentation
|
|
259
|
+
);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
const plugin = {
|
|
263
|
+
test(val) {
|
|
264
|
+
return Array.isArray(val);
|
|
265
|
+
},
|
|
266
|
+
serialize(array, config, indentation, depth, refs, printer) {
|
|
267
|
+
const name = array.constructor.name;
|
|
268
|
+
return ++depth > config.maxDepth
|
|
269
|
+
? `[${name}]`
|
|
270
|
+
: `${config.min ? '' : `${name} `}[${serializeItems(
|
|
271
|
+
array,
|
|
272
|
+
config,
|
|
273
|
+
indentation,
|
|
274
|
+
depth,
|
|
275
|
+
refs,
|
|
276
|
+
printer,
|
|
277
|
+
)}]`;
|
|
278
|
+
},
|
|
279
|
+
};
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
```js
|
|
283
|
+
const val = {
|
|
284
|
+
filter: 'completed',
|
|
285
|
+
items: [
|
|
286
|
+
{
|
|
287
|
+
text: 'Write test',
|
|
288
|
+
completed: true,
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
text: 'Write serialize',
|
|
292
|
+
completed: true,
|
|
293
|
+
},
|
|
294
|
+
],
|
|
295
|
+
};
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
```js
|
|
299
|
+
console.log(
|
|
300
|
+
prettyFormat(val, {
|
|
301
|
+
plugins: [plugin],
|
|
302
|
+
}),
|
|
303
|
+
);
|
|
304
|
+
/*
|
|
305
|
+
Object {
|
|
306
|
+
"filter": "completed",
|
|
307
|
+
"items": Array [
|
|
308
|
+
Object {
|
|
309
|
+
"completed": true,
|
|
310
|
+
"text": "Write test",
|
|
311
|
+
},
|
|
312
|
+
Object {
|
|
313
|
+
"completed": true,
|
|
314
|
+
"text": "Write serialize",
|
|
315
|
+
},
|
|
316
|
+
],
|
|
317
|
+
}
|
|
318
|
+
*/
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
```js
|
|
322
|
+
console.log(
|
|
323
|
+
prettyFormat(val, {
|
|
324
|
+
indent: 4,
|
|
325
|
+
plugins: [plugin],
|
|
326
|
+
}),
|
|
327
|
+
);
|
|
328
|
+
/*
|
|
329
|
+
Object {
|
|
330
|
+
"filter": "completed",
|
|
331
|
+
"items": Array [
|
|
332
|
+
Object {
|
|
333
|
+
"completed": true,
|
|
334
|
+
"text": "Write test",
|
|
335
|
+
},
|
|
336
|
+
Object {
|
|
337
|
+
"completed": true,
|
|
338
|
+
"text": "Write serialize",
|
|
339
|
+
},
|
|
340
|
+
],
|
|
341
|
+
}
|
|
342
|
+
*/
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
```js
|
|
346
|
+
console.log(
|
|
347
|
+
prettyFormat(val, {
|
|
348
|
+
maxDepth: 1,
|
|
349
|
+
plugins: [plugin],
|
|
350
|
+
}),
|
|
351
|
+
);
|
|
352
|
+
/*
|
|
353
|
+
Object {
|
|
354
|
+
"filter": "completed",
|
|
355
|
+
"items": [Array],
|
|
356
|
+
}
|
|
357
|
+
*/
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
```js
|
|
361
|
+
console.log(
|
|
362
|
+
prettyFormat(val, {
|
|
363
|
+
min: true,
|
|
364
|
+
plugins: [plugin],
|
|
365
|
+
}),
|
|
366
|
+
);
|
|
367
|
+
/*
|
|
368
|
+
{"filter": "completed", "items": [{"completed": true, "text": "Write test"}, {"completed": true, "text": "Write serialize"}]}
|
|
369
|
+
*/
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
### print
|
|
373
|
+
|
|
374
|
+
The **original** interface is adequate for plugins:
|
|
375
|
+
|
|
376
|
+
- that **do not** depend on options other than `highlight` or `min`
|
|
377
|
+
- that **do not** depend on `depth` or `refs` in recursive traversal, and
|
|
378
|
+
- if values either
|
|
379
|
+
- do **not** require indentation, or
|
|
380
|
+
- do **not** occur as children of JavaScript data structures (for example, array)
|
|
381
|
+
|
|
382
|
+
Write `print` to return a string, given the arguments:
|
|
383
|
+
|
|
384
|
+
- `val` which “passed the test”
|
|
385
|
+
- current `printer(valChild)` callback function: serialize children
|
|
386
|
+
- current `indenter(lines)` callback function: indent lines at the next level
|
|
387
|
+
- unchanging `config` object: derived from `options`
|
|
388
|
+
- unchanging `colors` object: derived from `options`
|
|
389
|
+
|
|
390
|
+
The 3 properties of `config` are `min` in `options` and:
|
|
391
|
+
|
|
392
|
+
- `spacing` and `edgeSpacing` are **newline** if `min` is `false`
|
|
393
|
+
- `spacing` is **space** and `edgeSpacing` is **empty string** if `min` is `true`
|
|
394
|
+
|
|
395
|
+
Each property of `colors` corresponds to a property of `theme` in `options`:
|
|
396
|
+
|
|
397
|
+
- the key is the same (for example, `tag`)
|
|
398
|
+
- the value in `colors` is a object with `open` and `close` properties whose values are escape codes from [ansi-styles](https://github.com/chalk/ansi-styles) for the color value in `theme` (for example, `'cyan'`)
|
|
399
|
+
|
|
400
|
+
### Example of print and test
|
|
401
|
+
|
|
402
|
+
This plugin prints functions with the **number of named arguments** excluding rest argument.
|
|
403
|
+
|
|
404
|
+
```js
|
|
405
|
+
const plugin = {
|
|
406
|
+
print(val) {
|
|
407
|
+
return `[Function ${val.name || 'anonymous'} ${val.length}]`;
|
|
408
|
+
},
|
|
409
|
+
test(val) {
|
|
410
|
+
return typeof val === 'function';
|
|
411
|
+
},
|
|
412
|
+
};
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
```js
|
|
416
|
+
const val = {
|
|
417
|
+
onClick(event) {},
|
|
418
|
+
render() {},
|
|
419
|
+
};
|
|
420
|
+
|
|
421
|
+
prettyFormat(val, {
|
|
422
|
+
plugins: [plugin],
|
|
423
|
+
});
|
|
424
|
+
/*
|
|
425
|
+
Object {
|
|
426
|
+
"onClick": [Function onClick 1],
|
|
427
|
+
"render": [Function render 0],
|
|
428
|
+
}
|
|
429
|
+
*/
|
|
430
|
+
|
|
431
|
+
prettyFormat(val);
|
|
432
|
+
/*
|
|
433
|
+
Object {
|
|
434
|
+
"onClick": [Function onClick],
|
|
435
|
+
"render": [Function render],
|
|
436
|
+
}
|
|
437
|
+
*/
|
|
438
|
+
```
|
|
439
|
+
|
|
440
|
+
This plugin **ignores** the `printFunctionName` option. That limitation of the original `print` interface is a reason to use the improved `serialize` interface, described above.
|
|
441
|
+
|
|
442
|
+
```js
|
|
443
|
+
prettyFormat(val, {
|
|
444
|
+
plugins: [pluginOld],
|
|
445
|
+
printFunctionName: false,
|
|
446
|
+
});
|
|
447
|
+
/*
|
|
448
|
+
Object {
|
|
449
|
+
"onClick": [Function onClick 1],
|
|
450
|
+
"render": [Function render 0],
|
|
451
|
+
}
|
|
452
|
+
*/
|
|
453
|
+
|
|
454
|
+
prettyFormat(val, {
|
|
455
|
+
printFunctionName: false,
|
|
456
|
+
});
|
|
457
|
+
/*
|
|
458
|
+
Object {
|
|
459
|
+
"onClick": [Function],
|
|
460
|
+
"render": [Function],
|
|
461
|
+
}
|
|
462
|
+
*/
|
|
463
|
+
```
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.printIteratorEntries = printIteratorEntries;
|
|
7
|
+
exports.printIteratorValues = printIteratorValues;
|
|
8
|
+
exports.printListItems = printListItems;
|
|
9
|
+
exports.printObjectProperties = printObjectProperties;
|
|
10
|
+
/**
|
|
11
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
12
|
+
*
|
|
13
|
+
* This source code is licensed under the MIT license found in the
|
|
14
|
+
* LICENSE file in the root directory of this source tree.
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
const getKeysOfEnumerableProperties = (object, compareKeys) => {
|
|
19
|
+
const rawKeys = Object.keys(object);
|
|
20
|
+
const keys = compareKeys !== null ? rawKeys.sort(compareKeys) : rawKeys;
|
|
21
|
+
if (Object.getOwnPropertySymbols) {
|
|
22
|
+
Object.getOwnPropertySymbols(object).forEach(symbol => {
|
|
23
|
+
if (Object.getOwnPropertyDescriptor(object, symbol).enumerable) {
|
|
24
|
+
keys.push(symbol);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
return keys;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Return entries (for example, of a map)
|
|
33
|
+
* with spacing, indentation, and comma
|
|
34
|
+
* without surrounding punctuation (for example, braces)
|
|
35
|
+
*/
|
|
36
|
+
function printIteratorEntries(
|
|
37
|
+
iterator,
|
|
38
|
+
config,
|
|
39
|
+
indentation,
|
|
40
|
+
depth,
|
|
41
|
+
refs,
|
|
42
|
+
printer,
|
|
43
|
+
// Too bad, so sad that separator for ECMAScript Map has been ' => '
|
|
44
|
+
// What a distracting diff if you change a data structure to/from
|
|
45
|
+
// ECMAScript Object or Immutable.Map/OrderedMap which use the default.
|
|
46
|
+
separator = ': '
|
|
47
|
+
) {
|
|
48
|
+
let result = '';
|
|
49
|
+
let width = 0;
|
|
50
|
+
let current = iterator.next();
|
|
51
|
+
if (!current.done) {
|
|
52
|
+
result += config.spacingOuter;
|
|
53
|
+
const indentationNext = indentation + config.indent;
|
|
54
|
+
while (!current.done) {
|
|
55
|
+
result += indentationNext;
|
|
56
|
+
if (width++ === config.maxWidth) {
|
|
57
|
+
result += '…';
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
60
|
+
const name = printer(
|
|
61
|
+
current.value[0],
|
|
62
|
+
config,
|
|
63
|
+
indentationNext,
|
|
64
|
+
depth,
|
|
65
|
+
refs
|
|
66
|
+
);
|
|
67
|
+
const value = printer(
|
|
68
|
+
current.value[1],
|
|
69
|
+
config,
|
|
70
|
+
indentationNext,
|
|
71
|
+
depth,
|
|
72
|
+
refs
|
|
73
|
+
);
|
|
74
|
+
result += name + separator + value;
|
|
75
|
+
current = iterator.next();
|
|
76
|
+
if (!current.done) {
|
|
77
|
+
result += `,${config.spacingInner}`;
|
|
78
|
+
} else if (!config.min) {
|
|
79
|
+
result += ',';
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
result += config.spacingOuter + indentation;
|
|
83
|
+
}
|
|
84
|
+
return result;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Return values (for example, of a set)
|
|
89
|
+
* with spacing, indentation, and comma
|
|
90
|
+
* without surrounding punctuation (braces or brackets)
|
|
91
|
+
*/
|
|
92
|
+
function printIteratorValues(
|
|
93
|
+
iterator,
|
|
94
|
+
config,
|
|
95
|
+
indentation,
|
|
96
|
+
depth,
|
|
97
|
+
refs,
|
|
98
|
+
printer
|
|
99
|
+
) {
|
|
100
|
+
let result = '';
|
|
101
|
+
let width = 0;
|
|
102
|
+
let current = iterator.next();
|
|
103
|
+
if (!current.done) {
|
|
104
|
+
result += config.spacingOuter;
|
|
105
|
+
const indentationNext = indentation + config.indent;
|
|
106
|
+
while (!current.done) {
|
|
107
|
+
result += indentationNext;
|
|
108
|
+
if (width++ === config.maxWidth) {
|
|
109
|
+
result += '…';
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
result += printer(current.value, config, indentationNext, depth, refs);
|
|
113
|
+
current = iterator.next();
|
|
114
|
+
if (!current.done) {
|
|
115
|
+
result += `,${config.spacingInner}`;
|
|
116
|
+
} else if (!config.min) {
|
|
117
|
+
result += ',';
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
result += config.spacingOuter + indentation;
|
|
121
|
+
}
|
|
122
|
+
return result;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Return items (for example, of an array)
|
|
127
|
+
* with spacing, indentation, and comma
|
|
128
|
+
* without surrounding punctuation (for example, brackets)
|
|
129
|
+
**/
|
|
130
|
+
function printListItems(list, config, indentation, depth, refs, printer) {
|
|
131
|
+
let result = '';
|
|
132
|
+
if (list.length) {
|
|
133
|
+
result += config.spacingOuter;
|
|
134
|
+
const indentationNext = indentation + config.indent;
|
|
135
|
+
for (let i = 0; i < list.length; i++) {
|
|
136
|
+
result += indentationNext;
|
|
137
|
+
if (i === config.maxWidth) {
|
|
138
|
+
result += '…';
|
|
139
|
+
break;
|
|
140
|
+
}
|
|
141
|
+
if (i in list) {
|
|
142
|
+
result += printer(list[i], config, indentationNext, depth, refs);
|
|
143
|
+
}
|
|
144
|
+
if (i < list.length - 1) {
|
|
145
|
+
result += `,${config.spacingInner}`;
|
|
146
|
+
} else if (!config.min) {
|
|
147
|
+
result += ',';
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
result += config.spacingOuter + indentation;
|
|
151
|
+
}
|
|
152
|
+
return result;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Return properties of an object
|
|
157
|
+
* with spacing, indentation, and comma
|
|
158
|
+
* without surrounding punctuation (for example, braces)
|
|
159
|
+
*/
|
|
160
|
+
function printObjectProperties(val, config, indentation, depth, refs, printer) {
|
|
161
|
+
let result = '';
|
|
162
|
+
const keys = getKeysOfEnumerableProperties(val, config.compareKeys);
|
|
163
|
+
if (keys.length) {
|
|
164
|
+
result += config.spacingOuter;
|
|
165
|
+
const indentationNext = indentation + config.indent;
|
|
166
|
+
for (let i = 0; i < keys.length; i++) {
|
|
167
|
+
const key = keys[i];
|
|
168
|
+
const name = printer(key, config, indentationNext, depth, refs);
|
|
169
|
+
const value = printer(val[key], config, indentationNext, depth, refs);
|
|
170
|
+
result += `${indentationNext + name}: ${value}`;
|
|
171
|
+
if (i < keys.length - 1) {
|
|
172
|
+
result += `,${config.spacingInner}`;
|
|
173
|
+
} else if (!config.min) {
|
|
174
|
+
result += ',';
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
result += config.spacingOuter + indentation;
|
|
178
|
+
}
|
|
179
|
+
return result;
|
|
180
|
+
}
|