diff --git a/CHANGELOG.md b/CHANGELOG.md index 06cbc29508b6..13584ad5f428 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -86,6 +86,7 @@ - [**BREAKING**] `--testPathPattern` is now `--testPathPatterns` - [**BREAKING**] Specifying `testPathPatterns` when programmatically calling `watch` must be specified as `new TestPathPatterns(patterns)`, where `TestPathPatterns` can be imported from `@jest/pattern` - `[jest-reporters, jest-runner]` Unhandled errors without stack get correctly logged to console ([#14619](https://github.com/jestjs/jest/pull/14619)) +- `[jest-util]` Always load `mjs` files with `import` ([#15447](https://github.com/jestjs/jest/pull/15447)) - `[jest-worker]` Properly handle a circular reference error when worker tries to send an assertion fails where either the expected or actual value is circular ([#15191](https://github.com/jestjs/jest/pull/15191)) - `[jest-worker]` Properly handle a BigInt when worker tries to send an assertion fails where either the expected or actual value is BigInt ([#15191](https://github.com/jestjs/jest/pull/15191)) @@ -122,6 +123,7 @@ - `[docs]` Link NestJS documentation on testing with Jest ([#14940](https://github.com/jestjs/jest/pull/14940)) - `[docs]` `Revised documentation for .toHaveBeenCalled()` to accurately depict its functionality. ([#14853](https://github.com/jestjs/jest/pull/14853)) - `[docs]` Removed ExpressJS reference link from documentation due to dead link ([#15270](https://github.com/jestjs/jest/pull/15270)) +- `[docs]` Removed `Running AngularJS Tests with Jest reference` link from documentation due to dead link ([#15270](https://github.com/jestjs/jest/pull/15311)) ## 29.7.0 diff --git a/docs/GlobalAPI.md b/docs/GlobalAPI.md index c4a545656d96..389499268c65 100644 --- a/docs/GlobalAPI.md +++ b/docs/GlobalAPI.md @@ -251,7 +251,7 @@ Use `describe.each` if you keep duplicating the same test suites with different - `%$` - Number of the test case. - `%%` - single percent sign ('%'). This does not consume an argument. - Or generate unique test titles by injecting properties of test case object with `$variable` - - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properites](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) + - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properties](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) - You can use `$#` to inject the index of the test case - You cannot use `$variable` with the `printf` formatting except for `%%` - `fn`: `Function` the suite of tests to be run, this is the function that will receive the parameters in each row as function arguments. @@ -305,7 +305,7 @@ describe.each([ - First row of variable name column headings separated with `|` - One or more subsequent rows of data supplied as template literal expressions using `${value}` syntax. - `name`: `String` the title of the test suite, use `$variable` to inject test data into the suite title from the tagged template expressions, and `$#` for the index of the row. - - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properites](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) + - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properties](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) - `fn`: `Function` the suite of tests to be run, this is the function that will receive the test data object. - Optionally, you can provide a `timeout` (in milliseconds) for specifying how long to wait for each row before aborting. The default timeout is 5 seconds. @@ -574,7 +574,7 @@ test.concurrent.each([ - First row of variable name column headings separated with `|` - One or more subsequent rows of data supplied as template literal expressions using `${value}` syntax. - `name`: `String` the title of the test, use `$variable` to inject test data into the test title from the tagged template expressions. - - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properites](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) + - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properties](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) - `fn`: `Function` the test to be run, this is the function that will receive the test data object, **this will have to be an asynchronous function**. - Optionally, you can provide a `timeout` (in milliseconds) for specifying how long to wait for each row before aborting. The default timeout is 5 seconds. @@ -697,7 +697,7 @@ Use `test.each` if you keep duplicating the same test with different data. `test - `%$` - Number of the test case. - `%%` - single percent sign ('%'). This does not consume an argument. - Or generate unique test titles by injecting properties of test case object with `$variable` - - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properites](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) + - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properties](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) - You can use `$#` to inject the index of the test case - You cannot use `$variable` with the `printf` formatting except for `%%` - `fn`: `Function` the test to be run, this is the function that will receive the parameters in each row as function arguments. @@ -731,7 +731,7 @@ test.each([ - First row of variable name column headings separated with `|` - One or more subsequent rows of data supplied as template literal expressions using `${value}` syntax. - `name`: `String` the title of the test, use `$variable` to inject test data into the test title from the tagged template expressions. - - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properites](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) + - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properties](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) - `fn`: `Function` the test to be run, this is the function that will receive the test data object. - Optionally, you can provide a `timeout` (in milliseconds) for specifying how long to wait for each row before aborting. The default timeout is 5 seconds. diff --git a/docs/TestingFrameworks.md b/docs/TestingFrameworks.md index f85556e56410..75f8b6b3bac8 100644 --- a/docs/TestingFrameworks.md +++ b/docs/TestingFrameworks.md @@ -17,7 +17,6 @@ Jest is a universal testing platform, with the ability to adapt to any JavaScrip ## AngularJS - [Testing an AngularJS app with Jest](https://medium.com/aya-experience/testing-an-angularjs-app-with-jest-3029a613251) by Matthieu Lux ([@Swiip](https://twitter.com/Swiip)) -- [Running AngularJS Tests with Jest](https://engineering.talentpair.com/running-angularjs-tests-with-jest-49d0cc9c6d26) by Ben Brandt ([@benjaminbrandt](https://twitter.com/benjaminbrandt)) - [AngularJS Unit Tests with Jest Actions (Traditional Chinese)](https://dwatow.github.io/2019/08-14-angularjs/angular-jest/?fbclid=IwAR2SrqYg_o6uvCQ79FdNPeOxs86dUqB6pPKgd9BgnHt1kuIDRyRM-ch11xg) by Chris Wang ([@dwatow](https://github.com/dwatow)) ## Angular diff --git a/e2e/esm-config/js/jest.config.js b/e2e/esm-config/js/jest.config.js index 22cb6befbeba..e9a929aed86a 100644 --- a/e2e/esm-config/js/jest.config.js +++ b/e2e/esm-config/js/jest.config.js @@ -5,7 +5,9 @@ * LICENSE file in the root directory of this source tree. */ +const displayName = await Promise.resolve('Config from js file'); + export default { - displayName: 'Config from js file', + displayName, testEnvironment: 'node', }; diff --git a/e2e/esm-config/mjs/jest.config.mjs b/e2e/esm-config/mjs/jest.config.mjs index 4e255c33887d..a426783bd541 100644 --- a/e2e/esm-config/mjs/jest.config.mjs +++ b/e2e/esm-config/mjs/jest.config.mjs @@ -5,7 +5,9 @@ * LICENSE file in the root directory of this source tree. */ +const displayName = await Promise.resolve('Config from mjs file'); + export default { - displayName: 'Config from mjs file', + displayName, testEnvironment: 'node', }; diff --git a/e2e/native-esm/yarn.lock b/e2e/native-esm/yarn.lock index f2e5a9364274..2fa76517b355 100644 --- a/e2e/native-esm/yarn.lock +++ b/e2e/native-esm/yarn.lock @@ -341,13 +341,13 @@ __metadata: linkType: hard "cross-spawn@npm:^7.0.0": - version: 7.0.3 - resolution: "cross-spawn@npm:7.0.3" + version: 7.0.6 + resolution: "cross-spawn@npm:7.0.6" dependencies: path-key: ^3.1.0 shebang-command: ^2.0.0 which: ^2.0.1 - checksum: 671cc7c7288c3a8406f3c69a3ae2fc85555c04169e9d611def9a675635472614f1c0ed0ef80955d5b6d4e724f6ced67f0ad1bb006c2ea643488fcfef994d7f52 + checksum: 8d306efacaf6f3f60e0224c287664093fa9185680b2d195852ba9a863f85d02dcc737094c6e512175f8ee0161f9b87c73c6826034c2422e39de7d6569cf4503b languageName: node linkType: hard diff --git a/package.json b/package.json index ec08468d2463..f37e7ce507df 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "strip-json-comments": "^3.1.1", "tempy": "^1.0.0", "ts-node": "^10.5.0", - "tstyche": "^2.0.0", + "tstyche": "^3.0.0", "typescript": "^5.0.4", "webpack": "^5.68.0", "webpack-node-externals": "^3.0.0", diff --git a/packages/diff-sequences/package.json b/packages/diff-sequences/package.json index 43eb98109a91..58c1566b4db7 100644 --- a/packages/diff-sequences/package.json +++ b/packages/diff-sequences/package.json @@ -32,7 +32,7 @@ "devDependencies": { "@fast-check/jest": "^2.0.0", "benchmark": "^2.1.4", - "diff": "^5.0.0" + "diff": "^7.0.0" }, "publishConfig": { "access": "public" diff --git a/packages/jest-config/package.json b/packages/jest-config/package.json index 587135537d7d..59e7a0496fd1 100644 --- a/packages/jest-config/package.json +++ b/packages/jest-config/package.json @@ -64,7 +64,7 @@ "@types/graceful-fs": "^4.1.3", "@types/micromatch": "^4.0.7", "@types/parse-json": "^4.0.0", - "esbuild": "^0.23.0", + "esbuild": "^0.24.0", "esbuild-register": "^3.4.0", "semver": "^7.5.3", "ts-node": "^10.5.0", diff --git a/packages/jest-config/src/__tests__/normalize.test.ts b/packages/jest-config/src/__tests__/normalize.test.ts index 9e9cb86d8d5a..0300d94e27c2 100644 --- a/packages/jest-config/src/__tests__/normalize.test.ts +++ b/packages/jest-config/src/__tests__/normalize.test.ts @@ -26,6 +26,23 @@ jest ...realFs, statSync: () => ({isDirectory: () => true}), }; + }) + .mock('jest-util', () => { + const realUtil = + jest.requireActual('jest-util'); + + return { + ...realUtil, + requireOrImportModule: (filePath: string, interop = true) => { + const result = require(filePath); + + if (interop) { + return realUtil.interopRequireDefault(result).default; + } + + return result; + }, + }; }); let root: string; diff --git a/packages/jest-each/README.md b/packages/jest-each/README.md index 7120b720b36c..c84b529225b5 100644 --- a/packages/jest-each/README.md +++ b/packages/jest-each/README.md @@ -122,7 +122,7 @@ const each = require('jest-each').default; - `%$` - Number of the test case. - `%%` - single percent sign ('%'). This does not consume an argument. - Or generate unique test titles by injecting properties of test case object with `$variable` - - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properites](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) + - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properties](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) - You can use `$#` to inject the index of the test case - You cannot use `$variable` with the `printf` formatting except for `%%` - testFn: `Function` the test logic, this is the function that will receive the parameters of each row as function arguments @@ -149,7 +149,7 @@ const each = require('jest-each').default; - `%$` - Number of the test case. - `%%` - single percent sign ('%'). This does not consume an argument. - Or generate unique test titles by injecting properties of test case object with `$variable` - - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properites](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) + - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properties](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) - You can use `$#` to inject the index of the test case - You cannot use `$variable` with the `printf` formatting except for `%%` - suiteFn: `Function` the suite of `test`/`it`s to be ran, this is the function that will receive the parameters in each row as function arguments @@ -381,7 +381,7 @@ each` ##### `.test`: - name: `String` the title of the `test`, use `$variable` in the name string to inject test values into the test title from the tagged template expressions - - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properites](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) + - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properties](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) - You can use `$#` to inject the index of the table row. - testFn: `Function` the test logic, this is the function that will receive the parameters of each row as function arguments @@ -418,7 +418,7 @@ each` ##### `.describe`: - name: `String` the title of the `test`, use `$variable` in the name string to inject test values into the test title from the tagged template expressions - - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properites](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) + - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properties](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) - suiteFn: `Function` the suite of `test`/`it`s to be ran, this is the function that will receive the parameters in each row as function arguments ### Usage diff --git a/packages/jest-environment/src/index.ts b/packages/jest-environment/src/index.ts index 04a02ae10c0c..892c99bd25f2 100644 --- a/packages/jest-environment/src/index.ts +++ b/packages/jest-environment/src/index.ts @@ -207,6 +207,18 @@ export interface Jest { moduleFactory?: () => T, options?: {virtual?: boolean}, ): Jest; + /** + * Registers a callback function that is invoked whenever a mock is generated for a module. + * This callback is passed the module name and the newly created mock object, and must return + * the (potentially modified) mock object. + * + * If multiple callbacks are registered, they will be called in the order they were added. + * Each callback receives the result of the previous callback as the `moduleMock` parameter, + * making it possible to apply sequential transformations. + * + * @param cb + */ + onGenerateMock(cb: (moduleName: string, moduleMock: T) => T): Jest; /** * Mocks a module with the provided module factory when it is being imported. */ diff --git a/packages/jest-expect/__typetests__/jest-expect.test.ts b/packages/jest-expect/__typetests__/jest-expect.test.ts index 966ac9e9fdd9..8360e0375c78 100644 --- a/packages/jest-expect/__typetests__/jest-expect.test.ts +++ b/packages/jest-expect/__typetests__/jest-expect.test.ts @@ -29,9 +29,9 @@ describe('JestExpect', () => { }); test('is superset of `Expect`', () => { - expect().type.toMatch(); + expect(jestExpect).type.toBeAssignableTo(_expect); - expect().type.not.toMatch(); + expect(_expect).type.not.toBeAssignableTo(jestExpect); }); test('allows type inference of the `actual` argument', () => { diff --git a/packages/jest-mock/__typetests__/mock-functions.test.ts b/packages/jest-mock/__typetests__/mock-functions.test.ts index d73d77f28326..fff6feedcec1 100644 --- a/packages/jest-mock/__typetests__/mock-functions.test.ts +++ b/packages/jest-mock/__typetests__/mock-functions.test.ts @@ -87,7 +87,7 @@ describe('jest.fn()', () => { test('models typings of mocked function', () => { // eslint-disable-next-line @typescript-eslint/ban-types - expect(fn()).type.toMatch(); + expect(fn()).type.toBeAssignableTo(); expect(fn()).type.toBe) => unknown>>(); expect(fn(() => {})).type.toBe void>>(); @@ -424,7 +424,7 @@ describe('jest.spyOn()', () => { test('models typings of spied object', () => { // eslint-disable-next-line @typescript-eslint/ban-types - expect(spy).type.not.toMatch(); + expect(spy).type.not.toBeAssignableTo(); expect(spy()).type.toRaiseError(); expect(new spy()).type.toRaiseError(); diff --git a/packages/jest-util/src/requireOrImportModule.ts b/packages/jest-util/src/requireOrImportModule.ts index 7124c8de95ae..84ea040a0bd4 100644 --- a/packages/jest-util/src/requireOrImportModule.ts +++ b/packages/jest-util/src/requireOrImportModule.ts @@ -9,6 +9,39 @@ import {isAbsolute} from 'path'; import {pathToFileURL} from 'url'; import interopRequireDefault from './interopRequireDefault'; +async function importModule( + filePath: string, + applyInteropRequireDefault: boolean, +) { + try { + const moduleUrl = pathToFileURL(filePath); + + // node `import()` supports URL, but TypeScript doesn't know that + const importedModule = await import( + /* webpackIgnore: true */ moduleUrl.href + ); + + if (!applyInteropRequireDefault) { + return importedModule; + } + + if (!importedModule.default) { + throw new Error( + `Jest: Failed to load ESM at ${filePath} - did you use a default export?`, + ); + } + + return importedModule.default; + } catch (error: any) { + if (error.message === 'Not supported') { + throw new Error( + `Jest: Your version of Node does not support dynamic import - please enable it or use a .cjs file extension for file ${filePath}`, + ); + } + throw error; + } +} + export default async function requireOrImportModule( filePath: string, applyInteropRequireDefault = true, @@ -19,40 +52,21 @@ export default async function requireOrImportModule( ); } try { + if (filePath.endsWith('.mjs')) { + return importModule(filePath, applyInteropRequireDefault); + } + const requiredModule = require(filePath); if (!applyInteropRequireDefault) { return requiredModule; } return interopRequireDefault(requiredModule).default; } catch (error: any) { - if (error.code === 'ERR_REQUIRE_ESM') { - try { - const moduleUrl = pathToFileURL(filePath); - - // node `import()` supports URL, but TypeScript doesn't know that - const importedModule = await import( - /* webpackIgnore: true */ moduleUrl.href - ); - - if (!applyInteropRequireDefault) { - return importedModule; - } - - if (!importedModule.default) { - throw new Error( - `Jest: Failed to load ESM at ${filePath} - did you use a default export?`, - ); - } - - return importedModule.default; - } catch (innerError: any) { - if (innerError.message === 'Not supported') { - throw new Error( - `Jest: Your version of Node does not support dynamic import - please enable it or use a .cjs file extension for file ${filePath}`, - ); - } - throw innerError; - } + if ( + error.code === 'ERR_REQUIRE_ESM' || + error.code === 'ERR_REQUIRE_ASYNC_MODULE' + ) { + return importModule(filePath, applyInteropRequireDefault); } else { throw error; } diff --git a/tstyche.config.json b/tstyche.config.json index 917ca2617ca0..bba3950eddc0 100644 --- a/tstyche.config.json +++ b/tstyche.config.json @@ -1,3 +1,4 @@ { - "testFileMatch": ["packages/*/__typetests__/*.test.ts"] + "$schema": "https://tstyche.org/schemas/config.json", + "testFileMatch": ["packages/*/__typetests__/**/*.test.ts"] } diff --git a/website/versioned_docs/version-29.4/GlobalAPI.md b/website/versioned_docs/version-29.4/GlobalAPI.md index 3a8649531b52..0772b528f0d0 100644 --- a/website/versioned_docs/version-29.4/GlobalAPI.md +++ b/website/versioned_docs/version-29.4/GlobalAPI.md @@ -250,7 +250,7 @@ Use `describe.each` if you keep duplicating the same test suites with different - `%#` - Index of the test case. - `%%` - single percent sign ('%'). This does not consume an argument. - Or generate unique test titles by injecting properties of test case object with `$variable` - - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properites](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) + - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properties](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) - You can use `$#` to inject the index of the test case - You cannot use `$variable` with the `printf` formatting except for `%%` - `fn`: `Function` the suite of tests to be run, this is the function that will receive the parameters in each row as function arguments. @@ -304,7 +304,7 @@ describe.each([ - First row of variable name column headings separated with `|` - One or more subsequent rows of data supplied as template literal expressions using `${value}` syntax. - `name`: `String` the title of the test suite, use `$variable` to inject test data into the suite title from the tagged template expressions, and `$#` for the index of the row. - - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properites](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) + - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properties](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) - `fn`: `Function` the suite of tests to be run, this is the function that will receive the test data object. - Optionally, you can provide a `timeout` (in milliseconds) for specifying how long to wait for each row before aborting. The default timeout is 5 seconds. @@ -572,7 +572,7 @@ test.concurrent.each([ - First row of variable name column headings separated with `|` - One or more subsequent rows of data supplied as template literal expressions using `${value}` syntax. - `name`: `String` the title of the test, use `$variable` to inject test data into the test title from the tagged template expressions. - - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properites](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) + - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properties](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) - `fn`: `Function` the test to be run, this is the function that will receive the test data object, **this will have to be an asynchronous function**. - Optionally, you can provide a `timeout` (in milliseconds) for specifying how long to wait for each row before aborting. The default timeout is 5 seconds. @@ -694,7 +694,7 @@ Use `test.each` if you keep duplicating the same test with different data. `test - `%#` - Index of the test case. - `%%` - single percent sign ('%'). This does not consume an argument. - Or generate unique test titles by injecting properties of test case object with `$variable` - - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properites](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) + - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properties](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) - You can use `$#` to inject the index of the test case - You cannot use `$variable` with the `printf` formatting except for `%%` - `fn`: `Function` the test to be run, this is the function that will receive the parameters in each row as function arguments. @@ -728,7 +728,7 @@ test.each([ - First row of variable name column headings separated with `|` - One or more subsequent rows of data supplied as template literal expressions using `${value}` syntax. - `name`: `String` the title of the test, use `$variable` to inject test data into the test title from the tagged template expressions. - - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properites](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) + - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properties](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) - `fn`: `Function` the test to be run, this is the function that will receive the test data object. - Optionally, you can provide a `timeout` (in milliseconds) for specifying how long to wait for each row before aborting. The default timeout is 5 seconds. diff --git a/website/versioned_docs/version-29.4/TestingFrameworks.md b/website/versioned_docs/version-29.4/TestingFrameworks.md index f85556e56410..75f8b6b3bac8 100644 --- a/website/versioned_docs/version-29.4/TestingFrameworks.md +++ b/website/versioned_docs/version-29.4/TestingFrameworks.md @@ -17,7 +17,6 @@ Jest is a universal testing platform, with the ability to adapt to any JavaScrip ## AngularJS - [Testing an AngularJS app with Jest](https://medium.com/aya-experience/testing-an-angularjs-app-with-jest-3029a613251) by Matthieu Lux ([@Swiip](https://twitter.com/Swiip)) -- [Running AngularJS Tests with Jest](https://engineering.talentpair.com/running-angularjs-tests-with-jest-49d0cc9c6d26) by Ben Brandt ([@benjaminbrandt](https://twitter.com/benjaminbrandt)) - [AngularJS Unit Tests with Jest Actions (Traditional Chinese)](https://dwatow.github.io/2019/08-14-angularjs/angular-jest/?fbclid=IwAR2SrqYg_o6uvCQ79FdNPeOxs86dUqB6pPKgd9BgnHt1kuIDRyRM-ch11xg) by Chris Wang ([@dwatow](https://github.com/dwatow)) ## Angular diff --git a/website/versioned_docs/version-29.5/GlobalAPI.md b/website/versioned_docs/version-29.5/GlobalAPI.md index 3a8649531b52..0772b528f0d0 100644 --- a/website/versioned_docs/version-29.5/GlobalAPI.md +++ b/website/versioned_docs/version-29.5/GlobalAPI.md @@ -250,7 +250,7 @@ Use `describe.each` if you keep duplicating the same test suites with different - `%#` - Index of the test case. - `%%` - single percent sign ('%'). This does not consume an argument. - Or generate unique test titles by injecting properties of test case object with `$variable` - - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properites](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) + - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properties](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) - You can use `$#` to inject the index of the test case - You cannot use `$variable` with the `printf` formatting except for `%%` - `fn`: `Function` the suite of tests to be run, this is the function that will receive the parameters in each row as function arguments. @@ -304,7 +304,7 @@ describe.each([ - First row of variable name column headings separated with `|` - One or more subsequent rows of data supplied as template literal expressions using `${value}` syntax. - `name`: `String` the title of the test suite, use `$variable` to inject test data into the suite title from the tagged template expressions, and `$#` for the index of the row. - - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properites](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) + - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properties](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) - `fn`: `Function` the suite of tests to be run, this is the function that will receive the test data object. - Optionally, you can provide a `timeout` (in milliseconds) for specifying how long to wait for each row before aborting. The default timeout is 5 seconds. @@ -572,7 +572,7 @@ test.concurrent.each([ - First row of variable name column headings separated with `|` - One or more subsequent rows of data supplied as template literal expressions using `${value}` syntax. - `name`: `String` the title of the test, use `$variable` to inject test data into the test title from the tagged template expressions. - - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properites](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) + - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properties](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) - `fn`: `Function` the test to be run, this is the function that will receive the test data object, **this will have to be an asynchronous function**. - Optionally, you can provide a `timeout` (in milliseconds) for specifying how long to wait for each row before aborting. The default timeout is 5 seconds. @@ -694,7 +694,7 @@ Use `test.each` if you keep duplicating the same test with different data. `test - `%#` - Index of the test case. - `%%` - single percent sign ('%'). This does not consume an argument. - Or generate unique test titles by injecting properties of test case object with `$variable` - - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properites](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) + - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properties](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) - You can use `$#` to inject the index of the test case - You cannot use `$variable` with the `printf` formatting except for `%%` - `fn`: `Function` the test to be run, this is the function that will receive the parameters in each row as function arguments. @@ -728,7 +728,7 @@ test.each([ - First row of variable name column headings separated with `|` - One or more subsequent rows of data supplied as template literal expressions using `${value}` syntax. - `name`: `String` the title of the test, use `$variable` to inject test data into the test title from the tagged template expressions. - - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properites](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) + - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properties](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) - `fn`: `Function` the test to be run, this is the function that will receive the test data object. - Optionally, you can provide a `timeout` (in milliseconds) for specifying how long to wait for each row before aborting. The default timeout is 5 seconds. diff --git a/website/versioned_docs/version-29.5/TestingFrameworks.md b/website/versioned_docs/version-29.5/TestingFrameworks.md index f85556e56410..75f8b6b3bac8 100644 --- a/website/versioned_docs/version-29.5/TestingFrameworks.md +++ b/website/versioned_docs/version-29.5/TestingFrameworks.md @@ -17,7 +17,6 @@ Jest is a universal testing platform, with the ability to adapt to any JavaScrip ## AngularJS - [Testing an AngularJS app with Jest](https://medium.com/aya-experience/testing-an-angularjs-app-with-jest-3029a613251) by Matthieu Lux ([@Swiip](https://twitter.com/Swiip)) -- [Running AngularJS Tests with Jest](https://engineering.talentpair.com/running-angularjs-tests-with-jest-49d0cc9c6d26) by Ben Brandt ([@benjaminbrandt](https://twitter.com/benjaminbrandt)) - [AngularJS Unit Tests with Jest Actions (Traditional Chinese)](https://dwatow.github.io/2019/08-14-angularjs/angular-jest/?fbclid=IwAR2SrqYg_o6uvCQ79FdNPeOxs86dUqB6pPKgd9BgnHt1kuIDRyRM-ch11xg) by Chris Wang ([@dwatow](https://github.com/dwatow)) ## Angular diff --git a/website/versioned_docs/version-29.6/GlobalAPI.md b/website/versioned_docs/version-29.6/GlobalAPI.md index 3a8649531b52..0772b528f0d0 100644 --- a/website/versioned_docs/version-29.6/GlobalAPI.md +++ b/website/versioned_docs/version-29.6/GlobalAPI.md @@ -250,7 +250,7 @@ Use `describe.each` if you keep duplicating the same test suites with different - `%#` - Index of the test case. - `%%` - single percent sign ('%'). This does not consume an argument. - Or generate unique test titles by injecting properties of test case object with `$variable` - - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properites](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) + - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properties](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) - You can use `$#` to inject the index of the test case - You cannot use `$variable` with the `printf` formatting except for `%%` - `fn`: `Function` the suite of tests to be run, this is the function that will receive the parameters in each row as function arguments. @@ -304,7 +304,7 @@ describe.each([ - First row of variable name column headings separated with `|` - One or more subsequent rows of data supplied as template literal expressions using `${value}` syntax. - `name`: `String` the title of the test suite, use `$variable` to inject test data into the suite title from the tagged template expressions, and `$#` for the index of the row. - - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properites](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) + - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properties](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) - `fn`: `Function` the suite of tests to be run, this is the function that will receive the test data object. - Optionally, you can provide a `timeout` (in milliseconds) for specifying how long to wait for each row before aborting. The default timeout is 5 seconds. @@ -572,7 +572,7 @@ test.concurrent.each([ - First row of variable name column headings separated with `|` - One or more subsequent rows of data supplied as template literal expressions using `${value}` syntax. - `name`: `String` the title of the test, use `$variable` to inject test data into the test title from the tagged template expressions. - - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properites](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) + - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properties](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) - `fn`: `Function` the test to be run, this is the function that will receive the test data object, **this will have to be an asynchronous function**. - Optionally, you can provide a `timeout` (in milliseconds) for specifying how long to wait for each row before aborting. The default timeout is 5 seconds. @@ -694,7 +694,7 @@ Use `test.each` if you keep duplicating the same test with different data. `test - `%#` - Index of the test case. - `%%` - single percent sign ('%'). This does not consume an argument. - Or generate unique test titles by injecting properties of test case object with `$variable` - - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properites](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) + - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properties](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) - You can use `$#` to inject the index of the test case - You cannot use `$variable` with the `printf` formatting except for `%%` - `fn`: `Function` the test to be run, this is the function that will receive the parameters in each row as function arguments. @@ -728,7 +728,7 @@ test.each([ - First row of variable name column headings separated with `|` - One or more subsequent rows of data supplied as template literal expressions using `${value}` syntax. - `name`: `String` the title of the test, use `$variable` to inject test data into the test title from the tagged template expressions. - - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properites](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) + - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properties](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) - `fn`: `Function` the test to be run, this is the function that will receive the test data object. - Optionally, you can provide a `timeout` (in milliseconds) for specifying how long to wait for each row before aborting. The default timeout is 5 seconds. diff --git a/website/versioned_docs/version-29.6/TestingFrameworks.md b/website/versioned_docs/version-29.6/TestingFrameworks.md index f85556e56410..75f8b6b3bac8 100644 --- a/website/versioned_docs/version-29.6/TestingFrameworks.md +++ b/website/versioned_docs/version-29.6/TestingFrameworks.md @@ -17,7 +17,6 @@ Jest is a universal testing platform, with the ability to adapt to any JavaScrip ## AngularJS - [Testing an AngularJS app with Jest](https://medium.com/aya-experience/testing-an-angularjs-app-with-jest-3029a613251) by Matthieu Lux ([@Swiip](https://twitter.com/Swiip)) -- [Running AngularJS Tests with Jest](https://engineering.talentpair.com/running-angularjs-tests-with-jest-49d0cc9c6d26) by Ben Brandt ([@benjaminbrandt](https://twitter.com/benjaminbrandt)) - [AngularJS Unit Tests with Jest Actions (Traditional Chinese)](https://dwatow.github.io/2019/08-14-angularjs/angular-jest/?fbclid=IwAR2SrqYg_o6uvCQ79FdNPeOxs86dUqB6pPKgd9BgnHt1kuIDRyRM-ch11xg) by Chris Wang ([@dwatow](https://github.com/dwatow)) ## Angular diff --git a/website/versioned_docs/version-29.7/GlobalAPI.md b/website/versioned_docs/version-29.7/GlobalAPI.md index c20c7acbf145..fd7852992756 100644 --- a/website/versioned_docs/version-29.7/GlobalAPI.md +++ b/website/versioned_docs/version-29.7/GlobalAPI.md @@ -250,7 +250,7 @@ Use `describe.each` if you keep duplicating the same test suites with different - `%#` - Index of the test case. - `%%` - single percent sign ('%'). This does not consume an argument. - Or generate unique test titles by injecting properties of test case object with `$variable` - - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properites](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) (only works for ["own" properites](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) + - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properties](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) (only works for ["own" properties](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) - You can use `$#` to inject the index of the test case - You cannot use `$variable` with the `printf` formatting except for `%%` - `fn`: `Function` the suite of tests to be run, this is the function that will receive the parameters in each row as function arguments. @@ -304,7 +304,7 @@ describe.each([ - First row of variable name column headings separated with `|` - One or more subsequent rows of data supplied as template literal expressions using `${value}` syntax. - `name`: `String` the title of the test suite, use `$variable` to inject test data into the suite title from the tagged template expressions, and `$#` for the index of the row. - - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properites](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) + - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properties](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) - `fn`: `Function` the suite of tests to be run, this is the function that will receive the test data object. - Optionally, you can provide a `timeout` (in milliseconds) for specifying how long to wait for each row before aborting. The default timeout is 5 seconds. @@ -572,7 +572,7 @@ test.concurrent.each([ - First row of variable name column headings separated with `|` - One or more subsequent rows of data supplied as template literal expressions using `${value}` syntax. - `name`: `String` the title of the test, use `$variable` to inject test data into the test title from the tagged template expressions. - - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properites](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) + - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properties](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) - `fn`: `Function` the test to be run, this is the function that will receive the test data object, **this will have to be an asynchronous function**. - Optionally, you can provide a `timeout` (in milliseconds) for specifying how long to wait for each row before aborting. The default timeout is 5 seconds. @@ -694,7 +694,7 @@ Use `test.each` if you keep duplicating the same test with different data. `test - `%#` - Index of the test case. - `%%` - single percent sign ('%'). This does not consume an argument. - Or generate unique test titles by injecting properties of test case object with `$variable` - - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properites](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) + - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properties](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) - You can use `$#` to inject the index of the test case - You cannot use `$variable` with the `printf` formatting except for `%%` - `fn`: `Function` the test to be run, this is the function that will receive the parameters in each row as function arguments. @@ -728,7 +728,7 @@ test.each([ - First row of variable name column headings separated with `|` - One or more subsequent rows of data supplied as template literal expressions using `${value}` syntax. - `name`: `String` the title of the test, use `$variable` to inject test data into the test title from the tagged template expressions. - - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properites](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) + - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properties](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work) - `fn`: `Function` the test to be run, this is the function that will receive the test data object. - Optionally, you can provide a `timeout` (in milliseconds) for specifying how long to wait for each row before aborting. The default timeout is 5 seconds. diff --git a/website/versioned_docs/version-29.7/TestingFrameworks.md b/website/versioned_docs/version-29.7/TestingFrameworks.md index f85556e56410..75f8b6b3bac8 100644 --- a/website/versioned_docs/version-29.7/TestingFrameworks.md +++ b/website/versioned_docs/version-29.7/TestingFrameworks.md @@ -17,7 +17,6 @@ Jest is a universal testing platform, with the ability to adapt to any JavaScrip ## AngularJS - [Testing an AngularJS app with Jest](https://medium.com/aya-experience/testing-an-angularjs-app-with-jest-3029a613251) by Matthieu Lux ([@Swiip](https://twitter.com/Swiip)) -- [Running AngularJS Tests with Jest](https://engineering.talentpair.com/running-angularjs-tests-with-jest-49d0cc9c6d26) by Ben Brandt ([@benjaminbrandt](https://twitter.com/benjaminbrandt)) - [AngularJS Unit Tests with Jest Actions (Traditional Chinese)](https://dwatow.github.io/2019/08-14-angularjs/angular-jest/?fbclid=IwAR2SrqYg_o6uvCQ79FdNPeOxs86dUqB6pPKgd9BgnHt1kuIDRyRM-ch11xg) by Chris Wang ([@dwatow](https://github.com/dwatow)) ## Angular diff --git a/yarn.lock b/yarn.lock index cc8fe5240380..c13da45c9c14 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2669,170 +2669,170 @@ __metadata: languageName: node linkType: hard -"@esbuild/aix-ppc64@npm:0.23.1": - version: 0.23.1 - resolution: "@esbuild/aix-ppc64@npm:0.23.1" +"@esbuild/aix-ppc64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/aix-ppc64@npm:0.24.0" conditions: os=aix & cpu=ppc64 languageName: node linkType: hard -"@esbuild/android-arm64@npm:0.23.1": - version: 0.23.1 - resolution: "@esbuild/android-arm64@npm:0.23.1" +"@esbuild/android-arm64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/android-arm64@npm:0.24.0" conditions: os=android & cpu=arm64 languageName: node linkType: hard -"@esbuild/android-arm@npm:0.23.1": - version: 0.23.1 - resolution: "@esbuild/android-arm@npm:0.23.1" +"@esbuild/android-arm@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/android-arm@npm:0.24.0" conditions: os=android & cpu=arm languageName: node linkType: hard -"@esbuild/android-x64@npm:0.23.1": - version: 0.23.1 - resolution: "@esbuild/android-x64@npm:0.23.1" +"@esbuild/android-x64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/android-x64@npm:0.24.0" conditions: os=android & cpu=x64 languageName: node linkType: hard -"@esbuild/darwin-arm64@npm:0.23.1": - version: 0.23.1 - resolution: "@esbuild/darwin-arm64@npm:0.23.1" +"@esbuild/darwin-arm64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/darwin-arm64@npm:0.24.0" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@esbuild/darwin-x64@npm:0.23.1": - version: 0.23.1 - resolution: "@esbuild/darwin-x64@npm:0.23.1" +"@esbuild/darwin-x64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/darwin-x64@npm:0.24.0" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@esbuild/freebsd-arm64@npm:0.23.1": - version: 0.23.1 - resolution: "@esbuild/freebsd-arm64@npm:0.23.1" +"@esbuild/freebsd-arm64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/freebsd-arm64@npm:0.24.0" conditions: os=freebsd & cpu=arm64 languageName: node linkType: hard -"@esbuild/freebsd-x64@npm:0.23.1": - version: 0.23.1 - resolution: "@esbuild/freebsd-x64@npm:0.23.1" +"@esbuild/freebsd-x64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/freebsd-x64@npm:0.24.0" conditions: os=freebsd & cpu=x64 languageName: node linkType: hard -"@esbuild/linux-arm64@npm:0.23.1": - version: 0.23.1 - resolution: "@esbuild/linux-arm64@npm:0.23.1" +"@esbuild/linux-arm64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/linux-arm64@npm:0.24.0" conditions: os=linux & cpu=arm64 languageName: node linkType: hard -"@esbuild/linux-arm@npm:0.23.1": - version: 0.23.1 - resolution: "@esbuild/linux-arm@npm:0.23.1" +"@esbuild/linux-arm@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/linux-arm@npm:0.24.0" conditions: os=linux & cpu=arm languageName: node linkType: hard -"@esbuild/linux-ia32@npm:0.23.1": - version: 0.23.1 - resolution: "@esbuild/linux-ia32@npm:0.23.1" +"@esbuild/linux-ia32@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/linux-ia32@npm:0.24.0" conditions: os=linux & cpu=ia32 languageName: node linkType: hard -"@esbuild/linux-loong64@npm:0.23.1": - version: 0.23.1 - resolution: "@esbuild/linux-loong64@npm:0.23.1" +"@esbuild/linux-loong64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/linux-loong64@npm:0.24.0" conditions: os=linux & cpu=loong64 languageName: node linkType: hard -"@esbuild/linux-mips64el@npm:0.23.1": - version: 0.23.1 - resolution: "@esbuild/linux-mips64el@npm:0.23.1" +"@esbuild/linux-mips64el@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/linux-mips64el@npm:0.24.0" conditions: os=linux & cpu=mips64el languageName: node linkType: hard -"@esbuild/linux-ppc64@npm:0.23.1": - version: 0.23.1 - resolution: "@esbuild/linux-ppc64@npm:0.23.1" +"@esbuild/linux-ppc64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/linux-ppc64@npm:0.24.0" conditions: os=linux & cpu=ppc64 languageName: node linkType: hard -"@esbuild/linux-riscv64@npm:0.23.1": - version: 0.23.1 - resolution: "@esbuild/linux-riscv64@npm:0.23.1" +"@esbuild/linux-riscv64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/linux-riscv64@npm:0.24.0" conditions: os=linux & cpu=riscv64 languageName: node linkType: hard -"@esbuild/linux-s390x@npm:0.23.1": - version: 0.23.1 - resolution: "@esbuild/linux-s390x@npm:0.23.1" +"@esbuild/linux-s390x@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/linux-s390x@npm:0.24.0" conditions: os=linux & cpu=s390x languageName: node linkType: hard -"@esbuild/linux-x64@npm:0.23.1": - version: 0.23.1 - resolution: "@esbuild/linux-x64@npm:0.23.1" +"@esbuild/linux-x64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/linux-x64@npm:0.24.0" conditions: os=linux & cpu=x64 languageName: node linkType: hard -"@esbuild/netbsd-x64@npm:0.23.1": - version: 0.23.1 - resolution: "@esbuild/netbsd-x64@npm:0.23.1" +"@esbuild/netbsd-x64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/netbsd-x64@npm:0.24.0" conditions: os=netbsd & cpu=x64 languageName: node linkType: hard -"@esbuild/openbsd-arm64@npm:0.23.1": - version: 0.23.1 - resolution: "@esbuild/openbsd-arm64@npm:0.23.1" +"@esbuild/openbsd-arm64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/openbsd-arm64@npm:0.24.0" conditions: os=openbsd & cpu=arm64 languageName: node linkType: hard -"@esbuild/openbsd-x64@npm:0.23.1": - version: 0.23.1 - resolution: "@esbuild/openbsd-x64@npm:0.23.1" +"@esbuild/openbsd-x64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/openbsd-x64@npm:0.24.0" conditions: os=openbsd & cpu=x64 languageName: node linkType: hard -"@esbuild/sunos-x64@npm:0.23.1": - version: 0.23.1 - resolution: "@esbuild/sunos-x64@npm:0.23.1" +"@esbuild/sunos-x64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/sunos-x64@npm:0.24.0" conditions: os=sunos & cpu=x64 languageName: node linkType: hard -"@esbuild/win32-arm64@npm:0.23.1": - version: 0.23.1 - resolution: "@esbuild/win32-arm64@npm:0.23.1" +"@esbuild/win32-arm64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/win32-arm64@npm:0.24.0" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@esbuild/win32-ia32@npm:0.23.1": - version: 0.23.1 - resolution: "@esbuild/win32-ia32@npm:0.23.1" +"@esbuild/win32-ia32@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/win32-ia32@npm:0.24.0" conditions: os=win32 & cpu=ia32 languageName: node linkType: hard -"@esbuild/win32-x64@npm:0.23.1": - version: 0.23.1 - resolution: "@esbuild/win32-x64@npm:0.23.1" +"@esbuild/win32-x64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/win32-x64@npm:0.24.0" conditions: os=win32 & cpu=x64 languageName: node linkType: hard @@ -3334,7 +3334,7 @@ __metadata: strip-json-comments: ^3.1.1 tempy: ^1.0.0 ts-node: ^10.5.0 - tstyche: ^2.0.0 + tstyche: ^3.0.0 typescript: ^5.0.4 webpack: ^5.68.0 webpack-node-externals: ^3.0.0 @@ -9174,7 +9174,7 @@ __metadata: dependencies: "@fast-check/jest": ^2.0.0 benchmark: ^2.1.4 - diff: ^5.0.0 + diff: ^7.0.0 languageName: unknown linkType: soft @@ -9185,10 +9185,10 @@ __metadata: languageName: node linkType: hard -"diff@npm:^5.0.0": - version: 5.2.0 - resolution: "diff@npm:5.2.0" - checksum: 12b63ca9c36c72bafa3effa77121f0581b4015df18bc16bac1f8e263597735649f1a173c26f7eba17fb4162b073fee61788abe49610e6c70a2641fe1895443fd +"diff@npm:^7.0.0": + version: 7.0.0 + resolution: "diff@npm:7.0.0" + checksum: 5db0d339476b18dfbc8a08a7504fbcc74789eec626c8d20cf2cdd1871f1448962888128f4447c8f50a1e41a80decfe5e8489c375843b8cf1d42b7c2b611da4e1 languageName: node linkType: hard @@ -9709,34 +9709,34 @@ __metadata: languageName: node linkType: hard -"esbuild@npm:^0.23.0": - version: 0.23.1 - resolution: "esbuild@npm:0.23.1" - dependencies: - "@esbuild/aix-ppc64": 0.23.1 - "@esbuild/android-arm": 0.23.1 - "@esbuild/android-arm64": 0.23.1 - "@esbuild/android-x64": 0.23.1 - "@esbuild/darwin-arm64": 0.23.1 - "@esbuild/darwin-x64": 0.23.1 - "@esbuild/freebsd-arm64": 0.23.1 - "@esbuild/freebsd-x64": 0.23.1 - "@esbuild/linux-arm": 0.23.1 - "@esbuild/linux-arm64": 0.23.1 - "@esbuild/linux-ia32": 0.23.1 - "@esbuild/linux-loong64": 0.23.1 - "@esbuild/linux-mips64el": 0.23.1 - "@esbuild/linux-ppc64": 0.23.1 - "@esbuild/linux-riscv64": 0.23.1 - "@esbuild/linux-s390x": 0.23.1 - "@esbuild/linux-x64": 0.23.1 - "@esbuild/netbsd-x64": 0.23.1 - "@esbuild/openbsd-arm64": 0.23.1 - "@esbuild/openbsd-x64": 0.23.1 - "@esbuild/sunos-x64": 0.23.1 - "@esbuild/win32-arm64": 0.23.1 - "@esbuild/win32-ia32": 0.23.1 - "@esbuild/win32-x64": 0.23.1 +"esbuild@npm:^0.24.0": + version: 0.24.0 + resolution: "esbuild@npm:0.24.0" + dependencies: + "@esbuild/aix-ppc64": 0.24.0 + "@esbuild/android-arm": 0.24.0 + "@esbuild/android-arm64": 0.24.0 + "@esbuild/android-x64": 0.24.0 + "@esbuild/darwin-arm64": 0.24.0 + "@esbuild/darwin-x64": 0.24.0 + "@esbuild/freebsd-arm64": 0.24.0 + "@esbuild/freebsd-x64": 0.24.0 + "@esbuild/linux-arm": 0.24.0 + "@esbuild/linux-arm64": 0.24.0 + "@esbuild/linux-ia32": 0.24.0 + "@esbuild/linux-loong64": 0.24.0 + "@esbuild/linux-mips64el": 0.24.0 + "@esbuild/linux-ppc64": 0.24.0 + "@esbuild/linux-riscv64": 0.24.0 + "@esbuild/linux-s390x": 0.24.0 + "@esbuild/linux-x64": 0.24.0 + "@esbuild/netbsd-x64": 0.24.0 + "@esbuild/openbsd-arm64": 0.24.0 + "@esbuild/openbsd-x64": 0.24.0 + "@esbuild/sunos-x64": 0.24.0 + "@esbuild/win32-arm64": 0.24.0 + "@esbuild/win32-ia32": 0.24.0 + "@esbuild/win32-x64": 0.24.0 dependenciesMeta: "@esbuild/aix-ppc64": optional: true @@ -9788,7 +9788,7 @@ __metadata: optional: true bin: esbuild: bin/esbuild - checksum: 0413c3b9257327fb598427688b7186ea335bf1693746fe5713cc93c95854d6388b8ed4ad643fddf5b5ace093f7dcd9038dd58e087bf2da1f04dfb4c5571660af + checksum: dd386d92a05c7eb03078480522cdd8b40c434777b5f08487c27971d30933ecaae3f08bd221958dd8f9c66214915cdc85f844283ca9bdbf8ee703d889ae526edd languageName: node linkType: hard @@ -10555,8 +10555,8 @@ __metadata: linkType: hard "express@npm:^4.17.3": - version: 4.21.1 - resolution: "express@npm:4.21.1" + version: 4.21.2 + resolution: "express@npm:4.21.2" dependencies: accepts: ~1.3.8 array-flatten: 1.1.1 @@ -10577,7 +10577,7 @@ __metadata: methods: ~1.1.2 on-finished: 2.4.1 parseurl: ~1.3.3 - path-to-regexp: 0.1.10 + path-to-regexp: 0.1.12 proxy-addr: ~2.0.7 qs: 6.13.0 range-parser: ~1.2.1 @@ -10589,7 +10589,7 @@ __metadata: type-is: ~1.6.18 utils-merge: 1.0.1 vary: ~1.1.2 - checksum: 5ac2b26d8aeddda5564fc0907227d29c100f90c0ead2ead9d474dc5108e8fb306c2de2083c4e3ba326e0906466f2b73417dbac16961f4075ff9f03785fd940fe + checksum: 3aef1d355622732e20b8f3a7c112d4391d44e2131f4f449e1f273a309752a41abfad714e881f177645517cbe29b3ccdc10b35e7e25c13506114244a5b72f549d languageName: node linkType: hard @@ -13184,7 +13184,7 @@ __metadata: chalk: ^4.0.0 ci-info: ^4.0.0 deepmerge: ^4.2.2 - esbuild: ^0.23.0 + esbuild: ^0.24.0 esbuild-register: ^3.4.0 glob: ^10.3.10 graceful-fs: ^4.2.9 @@ -16032,11 +16032,11 @@ __metadata: linkType: hard "nanoid@npm:^3.3.7": - version: 3.3.7 - resolution: "nanoid@npm:3.3.7" + version: 3.3.8 + resolution: "nanoid@npm:3.3.8" bin: nanoid: bin/nanoid.cjs - checksum: d36c427e530713e4ac6567d488b489a36582ef89da1d6d4e3b87eded11eb10d7042a877958c6f104929809b2ab0bafa17652b076cdf84324aa75b30b722204f2 + checksum: dfe0adbc0c77e9655b550c333075f51bb28cfc7568afbf3237249904f9c86c9aaaed1f113f0fddddba75673ee31c758c30c43d4414f014a52a7a626efc5958c9 languageName: node linkType: hard @@ -17047,10 +17047,10 @@ __metadata: languageName: node linkType: hard -"path-to-regexp@npm:0.1.10": - version: 0.1.10 - resolution: "path-to-regexp@npm:0.1.10" - checksum: ab7a3b7a0b914476d44030340b0a65d69851af2a0f33427df1476100ccb87d409c39e2182837a96b98fb38c4ef2ba6b87bdad62bb70a2c153876b8061760583c +"path-to-regexp@npm:0.1.12": + version: 0.1.12 + resolution: "path-to-regexp@npm:0.1.12" + checksum: ab237858bee7b25ecd885189f175ab5b5161e7b712b360d44f5c4516b8d271da3e4bf7bf0a7b9153ecb04c7d90ce8ff5158614e1208819cf62bac2b08452722e languageName: node linkType: hard @@ -20584,9 +20584,9 @@ __metadata: languageName: node linkType: hard -"tstyche@npm:^2.0.0": - version: 2.1.1 - resolution: "tstyche@npm:2.1.1" +"tstyche@npm:^3.0.0": + version: 3.2.0 + resolution: "tstyche@npm:3.2.0" peerDependencies: typescript: 4.x || 5.x peerDependenciesMeta: @@ -20594,7 +20594,7 @@ __metadata: optional: true bin: tstyche: ./build/bin.js - checksum: abbd751b6666faad2b646dfdf2c3a95ea9b948b6803fa1e1df3dc2290737437268d25cc0064c5d5e418a55cba7cbf5d346f072870491d831b9472a0da7201865 + checksum: 91be7f7136a722e254617ed98e4a6e2daa5170f41da5d7857d35816d4564a633f6e060e27e50599a4de32fdb3d404dae077a2aae72629089a54c68835e6542c9 languageName: node linkType: hard