Skip to content

Commit

Permalink
chore: update website links to avoid redirects (#11256)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Apr 2, 2021
1 parent f10cad1 commit 983de59
Show file tree
Hide file tree
Showing 30 changed files with 69 additions and 69 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Expand Up @@ -308,7 +308,7 @@
- `[jest-jasmine2]` Refine typings of `queueRunner` ([#10215](https://github.com/facebook/jest/pull/10215))
- `[jest-jasmine2]` Remove usage of `Function` type ([#10216](https://github.com/facebook/jest/pull/10216))
- `[jest-resolve]` Improve types ([#10239](https://github.com/facebook/jest/pull/10239))
- `[docs]` Clarify the [`jest.requireActual(moduleName)`](https://jestjs.io/docs/en/jest-object#jestrequireactualmodulename) example
- `[docs]` Clarify the [`jest.requireActual(moduleName)`](https://jestjs.io/docs/jest-object#jestrequireactualmodulename) example
- `[jest-types]` Refine typings of `coverageReporters` ([#10275](https://github.com/facebook/jest/pull/10275))

## 26.1.0
Expand Down Expand Up @@ -2501,7 +2501,7 @@ See https://jestjs.io/blog/2016/12/15/2016-in-jest.html
- Added `jest-resolve` as a standalone package based on the Facebook module resolution algorithm.
- Added `jest-changed-files` as a standalone package to detect changed files in a git or hg repo.
- Added `--setupTestFrameworkFile` to cli.
- Added support for coverage thresholds. See https://jestjs.io/docs/en/configuration#coveragethreshold-object.
- Added support for coverage thresholds. See https://jestjs.io/docs/configuration#coveragethreshold-object.
- Updated to jsdom 9.0.
- Updated and improved stack trace reporting.
- Added `module.filename` and removed the invalid `module.__filename` field.
Expand Down
12 changes: 6 additions & 6 deletions README.md
Expand Up @@ -110,7 +110,7 @@ Here's how to run Jest on files matching `my-test`, using `config.json` as a con
jest my-test --notify --config=config.json
```

If you'd like to learn more about running `jest` through the command line, take a look at the [Jest CLI Options](https://jestjs.io/docs/en/cli) page.
If you'd like to learn more about running `jest` through the command line, take a look at the [Jest CLI Options](https://jestjs.io/docs/cli) page.

## Additional Configuration

Expand Down Expand Up @@ -172,7 +172,7 @@ module.exports = {

### Using webpack

Jest can be used in projects that use [webpack](https://webpack.js.org/) to manage assets, styles, and compilation. webpack does offer some unique challenges over other tools. Refer to the [webpack guide](https://jestjs.io/docs/en/webpack) to get started.
Jest can be used in projects that use [webpack](https://webpack.js.org/) to manage assets, styles, and compilation. webpack does offer some unique challenges over other tools. Refer to the [webpack guide](https://jestjs.io/docs/webpack) to get started.

### Using parcel

Expand Down Expand Up @@ -206,10 +206,10 @@ However, there are some [caveats](https://babeljs.io/docs/en/babel-plugin-transf

Learn more about using [Jest on the official site!](https://jestjs.io)

- [Getting Started](https://jestjs.io/docs/en/getting-started)
- [Guides](https://jestjs.io/docs/en/snapshot-testing)
- [API Reference](https://jestjs.io/docs/en/api)
- [Configuring Jest](https://jestjs.io/docs/en/configuration)
- [Getting Started](https://jestjs.io/docs/getting-started)
- [Guides](https://jestjs.io/docs/snapshot-testing)
- [API Reference](https://jestjs.io/docs/api)
- [Configuring Jest](https://jestjs.io/docs/configuration)

## Badge

Expand Down
8 changes: 4 additions & 4 deletions docs/MockFunctionAPI.md
Expand Up @@ -381,16 +381,16 @@ test('calculate calls add', () => {
mockAdd.mockImplementation((a, b) => {
// Yes, this mock is still adding two numbers but imagine this
// was a complex function we are mocking.
return a + b
}));
return a + b;
});

// `mockAdd` is properly typed and therefore accepted by
// anything requiring `add`.
calculate(mockAdd, 1 , 2);
calculate(mockAdd, 1, 2);

expect(mockAdd).toBeCalledTimes(1);
expect(mockAdd).toBeCalledWith(1, 2);
})
});
```

### `jest.MockedClass`
Expand Down
Expand Up @@ -29,7 +29,7 @@ FAIL __tests__/test.js
You might want to include a file extension in your import, or update your 'moduleFileExtensions', which is currently ['js'].
See https://jestjs.io/docs/en/configuration#modulefileextensions-arraystring
See https://jestjs.io/docs/configuration#modulefileextensions-arraystring
6 | */
7 |
Expand Down
10 changes: 5 additions & 5 deletions e2e/__tests__/__snapshots__/wrongEnv.test.ts.snap
Expand Up @@ -8,7 +8,7 @@ FAIL __tests__/node.js
● use document
The error below may be caused by using the wrong test environment, see https://jestjs.io/docs/en/configuration#testenvironment-string.
The error below may be caused by using the wrong test environment, see https://jestjs.io/docs/configuration#testenvironment-string.
Consider using the "jsdom" test environment.
ReferenceError: document is not defined
Expand All @@ -32,7 +32,7 @@ FAIL __tests__/node.js
use navigator
The error below may be caused by using the wrong test environment, see https://jestjs.io/docs/en/configuration#testenvironment-string.
The error below may be caused by using the wrong test environment, see https://jestjs.io/docs/configuration#testenvironment-string.
Consider using the "jsdom" test environment.
ReferenceError: navigator is not defined
Expand All @@ -54,7 +54,7 @@ FAIL __tests__/jsdom.js
use unref
The error below may be caused by using the wrong test environment, see https://jestjs.io/docs/en/configuration#testenvironment-string.
The error below may be caused by using the wrong test environment, see https://jestjs.io/docs/configuration#testenvironment-string.
Consider using the "node" test environment.
TypeError: setTimeout(...).unref is not a function
Expand All @@ -78,7 +78,7 @@ FAIL __tests__/node.js
use window
The error below may be caused by using the wrong test environment, see https://jestjs.io/docs/en/configuration#testenvironment-string.
The error below may be caused by using the wrong test environment, see https://jestjs.io/docs/configuration#testenvironment-string.
Consider using the "jsdom" test environment.
ReferenceError: window is not defined
Expand All @@ -98,7 +98,7 @@ exports[`Wrong globals for environment print useful error when it explodes durin
FAIL __tests__/beforeTest.js
Test suite failed to run
The error below may be caused by using the wrong test environment, see https://jestjs.io/docs/en/configuration#testenvironment-string.
The error below may be caused by using the wrong test environment, see https://jestjs.io/docs/configuration#testenvironment-string.
Consider using the "jsdom" test environment.
ReferenceError: document is not defined
Expand Down
2 changes: 1 addition & 1 deletion e2e/__tests__/supportsDashedArgs.ts
Expand Up @@ -48,7 +48,7 @@ test('throws error for unknown dashed & camelcase args', () => {
["doesNotExist", "also-does-not-exist"]
CLI Options Documentation:
https://jestjs.io/docs/en/cli.html
https://jestjs.io/docs/cli
`);
expect(exitCode).toBe(1);
Expand Down
2 changes: 1 addition & 1 deletion examples/mongodb/jest.config.js
@@ -1,5 +1,5 @@
// For a detailed explanation regarding each configuration property, visit:
// https://jestjs.io/docs/en/configuration.html
// https://jestjs.io/docs/configuration

module.exports = {
// A path to a module which exports an async function that is triggered once before all test suites
Expand Down
2 changes: 1 addition & 1 deletion packages/expect/README.md
@@ -1,3 +1,3 @@
# expect

This package exports the `expect` function used in [Jest](https://jestjs.io/). You can find its documentation [on Jest's website](https://jestjs.io/docs/en/expect.html).
This package exports the `expect` function used in [Jest](https://jestjs.io/). You can find its documentation [on Jest's website](https://jestjs.io/docs/expect).
8 changes: 4 additions & 4 deletions packages/expect/src/types.ts
Expand Up @@ -310,21 +310,21 @@ export interface Matchers<R> {
/* TODO: START snapshot matchers are not from `expect`, the types should not be here */
/**
* This ensures that a value matches the most recent snapshot with property matchers.
* Check out [the Snapshot Testing guide](https://jestjs.io/docs/en/snapshot-testing) for more information.
* Check out [the Snapshot Testing guide](https://jestjs.io/docs/snapshot-testing) for more information.
*/
toMatchSnapshot<T extends {[P in keyof R]: unknown}>(
propertyMatchers: Partial<T>,
snapshotName?: string,
): R;
/**
* This ensures that a value matches the most recent snapshot.
* Check out [the Snapshot Testing guide](https://jestjs.io/docs/en/snapshot-testing) for more information.
* Check out [the Snapshot Testing guide](https://jestjs.io/docs/snapshot-testing) for more information.
*/
toMatchSnapshot(snapshotName?: string): R;
/**
* This ensures that a value matches the most recent snapshot with property matchers.
* Instead of writing the snapshot value to a .snap file, it will be written into the source code automatically.
* Check out [the Snapshot Testing guide](https://jestjs.io/docs/en/snapshot-testing) for more information.
* Check out [the Snapshot Testing guide](https://jestjs.io/docs/snapshot-testing) for more information.
*/
toMatchInlineSnapshot<T extends {[P in keyof R]: unknown}>(
propertyMatchers: Partial<T>,
Expand All @@ -333,7 +333,7 @@ export interface Matchers<R> {
/**
* This ensures that a value matches the most recent snapshot with property matchers.
* Instead of writing the snapshot value to a .snap file, it will be written into the source code automatically.
* Check out [the Snapshot Testing guide](https://jestjs.io/docs/en/snapshot-testing) for more information.
* Check out [the Snapshot Testing guide](https://jestjs.io/docs/snapshot-testing) for more information.
*/
toMatchInlineSnapshot(snapshot?: string): R;
/**
Expand Down
4 changes: 2 additions & 2 deletions packages/jest-circus/README.md
Expand Up @@ -9,7 +9,7 @@

Circus is a flux-based test runner for Jest that is fast, maintainable, and simple to extend.

Circus allows you to bind to events via an optional event handler on any [custom environment](https://jestjs.io/docs/en/configuration#testenvironment-string). See the [type definitions](https://github.com/facebook/jest/blob/master/packages/jest-circus/src/types.ts) for more information on the events and state data currently available.
Circus allows you to bind to events via an optional event handler on any [custom environment](https://jestjs.io/docs/configuration#testenvironment-string). See the [type definitions](https://github.com/facebook/jest/blob/master/packages/jest-circus/src/types.ts) for more information on the events and state data currently available.

```js
import {Event, State} from 'jest-circus';
Expand Down Expand Up @@ -48,7 +48,7 @@ npm install --save-dev jest-circus

## Configure

Configure Jest to use `jest-circus` via the [`testRunner`](https://jestjs.io/docs/en/configuration#testrunner-string) option:
Configure Jest to use `jest-circus` via the [`testRunner`](https://jestjs.io/docs/configuration#testrunner-string) option:

```json
{
Expand Down
Expand Up @@ -118,7 +118,7 @@ Array [
exports[`init project with package.json and no jest config all questions answered with answer: "No" should return the default configuration (an empty config) 1`] = `
"/*
* For a detailed explanation regarding each configuration property, visit:
* https://jestjs.io/docs/en/configuration.html
* https://jestjs.io/docs/configuration
*/
module.exports = {
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-cli/src/init/generateConfigFile.ts
Expand Up @@ -91,7 +91,7 @@ const generateConfigFile = (
* For a detailed explanation regarding each configuration property${
useTypescript ? ' and type check' : ''
}, visit:
* https://jestjs.io/docs/en/configuration.html
* https://jestjs.io/docs/configuration
*/
`;
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-config/src/Deprecated.ts
Expand Up @@ -15,7 +15,7 @@ const deprecatedOptions: DeprecatedOptions = {
browser: () =>
` Option ${chalk.bold(
'"browser"',
)} has been deprecated. Please install "browser-resolve" and use the "resolver" option in Jest configuration as shown in the documentation: https://jestjs.io/docs/en/configuration#resolver-string`,
)} has been deprecated. Please install "browser-resolve" and use the "resolver" option in Jest configuration as shown in the documentation: https://jestjs.io/docs/configuration#resolver-string`,

preprocessorIgnorePatterns: (options: {
preprocessorIgnorePatterns?: Array<string>;
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-message-util/src/index.ts
Expand Up @@ -111,7 +111,7 @@ function warnAboutWrongTestEnvironment(error: string, env: 'jsdom' | 'node') {
return (
chalk.bold.red(
`The error below may be caused by using the wrong test environment, see ${chalk.dim.underline(
'https://jestjs.io/docs/en/configuration#testenvironment-string',
'https://jestjs.io/docs/configuration#testenvironment-string',
)}.\nConsider using the "${env}" test environment.\n\n`,
) + error
);
Expand Down
Expand Up @@ -8,5 +8,5 @@ However, Jest was able to find:
You might want to include a file extension in your import, or update your 'moduleFileExtensions', which is currently ['js', 'jsx', 'ts', 'tsx', 'json', 'node'].
See https://jestjs.io/docs/en/configuration#modulefileextensions-arraystring"
See https://jestjs.io/docs/configuration#modulefileextensions-arraystring"
`;
2 changes: 1 addition & 1 deletion packages/jest-runtime/src/helpers.ts
Expand Up @@ -64,7 +64,7 @@ export const findSiblingsWithFileExtension = (
return (
foundMessage +
"\n\nYou might want to include a file extension in your import, or update your 'moduleFileExtensions', which is currently " +
`[${mappedModuleFileExtensions}].\n\nSee https://jestjs.io/docs/en/configuration#modulefileextensions-arraystring`
`[${mappedModuleFileExtensions}].\n\nSee https://jestjs.io/docs/configuration#modulefileextensions-arraystring`
);
}
} catch {}
Expand Down
6 changes: 3 additions & 3 deletions packages/jest-runtime/src/index.ts
Expand Up @@ -433,7 +433,7 @@ export default class Runtime {
) => {
invariant(
runtimeSupportsVmModules,
'You need to run with a version of node that supports ES Modules in the VM API. See https://jestjs.io/docs/en/ecmascript-modules',
'You need to run with a version of node that supports ES Modules in the VM API. See https://jestjs.io/docs/ecmascript-modules',
);
const module = await this.resolveModule(
specifier,
Expand Down Expand Up @@ -538,7 +538,7 @@ export default class Runtime {
): Promise<void> {
invariant(
runtimeSupportsVmModules,
'You need to run with a version of node that supports ES Modules in the VM API. See https://jestjs.io/docs/en/ecmascript-modules',
'You need to run with a version of node that supports ES Modules in the VM API. See https://jestjs.io/docs/ecmascript-modules',
);

const [path, query] = (moduleName ?? '').split('?');
Expand Down Expand Up @@ -1303,7 +1303,7 @@ export default class Runtime {
importModuleDynamically: async (specifier: string) => {
invariant(
runtimeSupportsVmModules,
'You need to run with a version of node that supports ES Modules in the VM API. See https://jestjs.io/docs/en/ecmascript-modules',
'You need to run with a version of node that supports ES Modules in the VM API. See https://jestjs.io/docs/ecmascript-modules',
);

const context = this._environment.getVmContext?.();
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-snapshot/src/SnapshotResolver.ts
Expand Up @@ -97,7 +97,7 @@ function mustImplement(propName: string, requiredType: string) {
chalk.bold(
`Custom snapshot resolver must implement a \`${propName}\` as a ${requiredType}.`,
) +
'\nDocumentation: https://facebook.github.io/jest/docs/en/configuration.html#snapshotResolver'
'\nDocumentation: https://facebook.github.io/jest/docs/configuration.html#snapshotResolver'
);
}

Expand Down
Expand Up @@ -4,15 +4,15 @@ exports[`malformed custom resolver in project config inconsistent functions thro
exports[`malformed custom resolver in project config missing resolveSnapshotPath throws 1`] = `
"<bold>Custom snapshot resolver must implement a \`resolveSnapshotPath\` as a function.</>
Documentation: https://facebook.github.io/jest/docs/en/configuration.html#snapshotResolver"
Documentation: https://facebook.github.io/jest/docs/configuration.html#snapshotResolver"
`;
exports[`malformed custom resolver in project config missing resolveTestPath throws 1`] = `
"<bold>Custom snapshot resolver must implement a \`resolveTestPath\` as a function.</>
Documentation: https://facebook.github.io/jest/docs/en/configuration.html#snapshotResolver"
Documentation: https://facebook.github.io/jest/docs/configuration.html#snapshotResolver"
`;
exports[`malformed custom resolver in project config missing testPathForConsistencyCheck throws 1`] = `
"<bold>Custom snapshot resolver must implement a \`testPathForConsistencyCheck\` as a string.</>
Documentation: https://facebook.github.io/jest/docs/en/configuration.html#snapshotResolver"
Documentation: https://facebook.github.io/jest/docs/configuration.html#snapshotResolver"
`;
6 changes: 3 additions & 3 deletions packages/jest-transform/src/enhanceUnexpectedTokenMessage.ts
Expand Up @@ -43,7 +43,7 @@ By default "node_modules" folder is ignored by transformers.
Here's what you can do:
${DOT}If you are trying to use ECMAScript Modules, see ${chalk.underline(
'https://jestjs.io/docs/en/ecmascript-modules',
'https://jestjs.io/docs/ecmascript-modules',
)} for how to enable it.
${DOT}To have some of your "node_modules" files transformed, you can specify a custom ${chalk.bold(
'"transformIgnorePatterns"',
Expand All @@ -56,9 +56,9 @@ ${DOT}If you simply want to mock your non-JS modules (e.g. binary assets) you ca
)} config option.
You'll find more details and examples of these config options in the docs:
${chalk.cyan('https://jestjs.io/docs/en/configuration')}
${chalk.cyan('https://jestjs.io/docs/configuration')}
For information about custom transformations, see:
${chalk.cyan('https://jestjs.io/docs/en/code-transformation')}
${chalk.cyan('https://jestjs.io/docs/code-transformation')}
${chalk.bold.red('Details:')}
Expand Down
Expand Up @@ -6,7 +6,7 @@ exports[`does not show suggestion when unrecognized cli param length <= 1 1`] =
<red> Unrecognized option <bold>\\"l\\"</>.</>
<red></>
<red> <bold>CLI Options Documentation</>:</>
<red> https://jestjs.io/docs/en/cli.html</>
<red> https://jestjs.io/docs/cli</>
<red></>"
`;
Expand All @@ -17,7 +17,7 @@ exports[`fails for multiple unknown options 1`] = `
<red> <bold>[\\"jest\\", \\"test\\"]</></>
<red></>
<red> <bold>CLI Options Documentation</>:</>
<red> https://jestjs.io/docs/en/cli.html</>
<red> https://jestjs.io/docs/cli</>
<red></>"
`;
Expand All @@ -27,7 +27,7 @@ exports[`fails for unknown option 1`] = `
<red> Unrecognized option <bold>\\"unknown\\"</>.</>
<red></>
<red> <bold>CLI Options Documentation</>:</>
<red> https://jestjs.io/docs/en/cli.html</>
<red> https://jestjs.io/docs/cli</>
<red></>"
`;
Expand All @@ -37,6 +37,6 @@ exports[`shows suggestion when unrecognized cli param length > 1 1`] = `
<red> Unrecognized option <bold>\\"hell\\"</>. Did you mean <bold>\\"help\\"</>?</>
<red></>
<red> <bold>CLI Options Documentation</>:</>
<red> https://jestjs.io/docs/en/cli.html</>
<red> https://jestjs.io/docs/cli</>
<red></>"
`;
4 changes: 2 additions & 2 deletions packages/jest-validate/src/validateCLIOptions.ts
Expand Up @@ -16,7 +16,7 @@ import {ValidationError, createDidYouMeanMessage, format} from './utils';

const BULLET: string = chalk.bold('\u25cf');
export const DOCUMENTATION_NOTE = ` ${chalk.bold('CLI Options Documentation:')}
https://jestjs.io/docs/en/cli.html
https://jestjs.io/docs/cli
`;

const createCLIValidationError = (
Expand All @@ -27,7 +27,7 @@ const createCLIValidationError = (
let message;
const comment =
` ${chalk.bold('CLI Options Documentation')}:\n` +
` https://jestjs.io/docs/en/cli.html\n`;
` https://jestjs.io/docs/cli\n`;

if (unrecognizedOptions.length === 1) {
const unrecognized = unrecognizedOptions[0];
Expand Down
2 changes: 1 addition & 1 deletion test-types/top-level-globals.test.ts
Expand Up @@ -28,7 +28,7 @@ const timeout = 5;
const testName = 'Test name';
const testTable = [[1, 2]];

// https://jestjs.io/docs/en/api#methods
// https://jestjs.io/docs/api#methods
expectType<void>(afterAll(fn));
expectType<void>(afterAll(asyncFn));
expectType<void>(afterAll(genFn));
Expand Down

0 comments on commit 983de59

Please sign in to comment.