Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update dependencies #12357

Merged
merged 10 commits into from Feb 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Expand Up @@ -26,10 +26,13 @@
- `[*]` [**BREAKING**] Drop support for `typescript@3.8`, minimum version is now `4.2` ([#11142](https://github.com/facebook/jest/pull/11142))
- `[*]` Bundle all `.d.ts` files into a single `index.d.ts` per module ([#12345](https://github.com/facebook/jest/pull/12345))
- `[expect]` [**BREAKING**] Remove support for importing `build/utils` ([#12323](https://github.com/facebook/jest/pull/12323))
- `[jest-cli]` Update `yargs` to v17 ([#12357](https://github.com/facebook/jest/pull/12357))
- `[jest-config]` [**BREAKING**] Remove `getTestEnvironment` export ([#12353](https://github.com/facebook/jest/pull/12353))
- `[@jest/core]` Use `index.ts` instead of `jest.ts` as main export ([#12329](https://github.com/facebook/jest/pull/12329))
- `[@jest/fake-timers]` Update `@sinonjs/fake_timers` to v9 ([#12357](https://github.com/facebook/jest/pull/12357))
- `[jest-resolve]` [**BREAKING**] Make `requireResolveFunction` argument mandatory ([#12353](https://github.com/facebook/jest/pull/12353))
- `[jest-runner]` [**BREAKING**] Remove some type exports from `@jest/test-result` ([#12353](https://github.com/facebook/jest/pull/12353))
- `[jest-transform]` Update `write-file-atomic` to v4 ([#12357](https://github.com/facebook/jest/pull/12357))
- `[jest]` Use `index.ts` instead of `jest.ts` as main export ([#12329](https://github.com/facebook/jest/pull/12329))

### Performance
Expand Down
2 changes: 1 addition & 1 deletion e2e/__tests__/__snapshots__/jest.config.ts.test.ts.snap
Expand Up @@ -4,7 +4,7 @@ exports[`traverses directory tree up until it finds jest.config 1`] = `
" console.log
<<REPLACED>>/jest-config-ts/some/nested/directory

at Object.log (__tests__/a-giraffe.js:3:27)
at Object.<anonymous> (__tests__/a-giraffe.js:3:27)
"
`;

Expand Down
4 changes: 2 additions & 2 deletions examples/mongodb/package.json
Expand Up @@ -6,8 +6,8 @@
"private": true,
"dependencies": {
"jest-environment-node": "*",
"mongodb": "^3.1.13",
"mongodb-memory-server": "^6.9.6"
"mongodb": "^4.3.1",
"mongodb-memory-server": "^8.3.0"
},
"devDependencies": {
"@babel/core": "*",
Expand Down
6 changes: 3 additions & 3 deletions package.json
Expand Up @@ -58,11 +58,11 @@
"jest-runner-tsd": "^3.0.0",
"jest-silent-reporter": "^0.5.0",
"jest-snapshot": "workspace:*",
"jest-watch-typeahead": "^0.6.0",
"jest-watch-typeahead": "^1.0.0",
"jquery": "^3.2.1",
"lerna": "^4.0.0",
"micromatch": "^4.0.4",
"mock-fs": "^4.4.1",
"mock-fs": "^5.1.2",
"netlify-plugin-cache": "^1.0.3",
"node-notifier": "^10.0.0",
"pkg-dir": "^5.0.0",
Expand All @@ -79,7 +79,7 @@
"strip-json-comments": "^3.1.1",
"tempy": "^1.0.0",
"throat": "^6.0.1",
"ts-node": "^9.0.0",
"ts-node": "^10.5.0",
"type-fest": "^2.11.2",
"typescript": "^4.0.2",
"which": "^2.0.1"
Expand Down
4 changes: 2 additions & 2 deletions packages/jest-cli/package.json
Expand Up @@ -24,13 +24,13 @@
"jest-util": "^27.5.1",
"jest-validate": "^27.5.1",
"prompts": "^2.0.1",
"yargs": "^16.2.0"
"yargs": "^17.3.1"
},
"devDependencies": {
"@types/exit": "^0.1.30",
"@types/graceful-fs": "^4.1.3",
"@types/prompts": "^2.0.1",
"@types/yargs": "^16.0.0"
"@types/yargs": "^17.0.8"
},
"peerDependencies": {
"node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0"
Expand Down
4 changes: 2 additions & 2 deletions packages/jest-cli/src/__tests__/cli/args.test.ts
Expand Up @@ -107,13 +107,13 @@ describe('check', () => {
});

describe('buildArgv', () => {
it('should return only camelcased args ', () => {
it('should return only camelcased args ', async () => {
const mockProcessArgv = jest
// @ts-expect-error
.spyOn(process.argv, 'slice')
.mockImplementation(() => ['--clear-mocks']);

const actual = buildArgv();
const actual = await buildArgv();
expect(actual).not.toHaveProperty('clear-mocks');
expect(actual).toHaveProperty('clearMocks', true);
mockProcessArgv.mockRestore();
Expand Down
5 changes: 0 additions & 5 deletions packages/jest-cli/src/cli/args.ts
Expand Up @@ -659,11 +659,6 @@ export const options = {
'Display individual test results with the test suite hierarchy.',
type: 'boolean',
},
version: {
alias: 'v',
description: 'Print the version and exit',
type: 'boolean',
},
watch: {
description:
'Watch files for changes and rerun tests related to ' +
Expand Down
13 changes: 7 additions & 6 deletions packages/jest-cli/src/cli/index.ts
Expand Up @@ -23,7 +23,7 @@ export async function run(
project?: Config.Path,
): Promise<void> {
try {
const argv: Config.Argv = buildArgv(maybeArgv);
const argv = await buildArgv(maybeArgv);

if (argv.init) {
await init();
Expand All @@ -48,14 +48,15 @@ export async function run(
}
}

export const buildArgv = (maybeArgv?: Array<string>): Config.Argv => {
export async function buildArgv(
maybeArgv?: Array<string>,
): Promise<Config.Argv> {
const version =
getVersion() +
(__dirname.includes(`packages${path.sep}jest-cli`) ? '-dev' : '');

const rawArgv: Config.Argv | Array<string> =
maybeArgv || process.argv.slice(2);
const argv: Config.Argv = yargs(rawArgv)
const rawArgv: Array<string> = maybeArgv || process.argv.slice(2);
const argv: Config.Argv = await yargs(rawArgv)
.usage(args.usage)
.version(version)
.alias('help', 'h')
Expand All @@ -82,7 +83,7 @@ export const buildArgv = (maybeArgv?: Array<string>): Config.Argv => {
},
{$0: argv.$0, _: argv._},
);
};
}

const getProjectListFromCLIArgs = (
argv: Config.Argv,
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-config/package.json
Expand Up @@ -53,7 +53,7 @@
"@types/graceful-fs": "^4.1.3",
"@types/micromatch": "^4.0.1",
"semver": "^7.3.5",
"ts-node": "^9.0.0",
"ts-node": "^10.5.0",
"typescript": "^4.0.3"
},
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-fake-timers/package.json
Expand Up @@ -18,7 +18,7 @@
},
"dependencies": {
"@jest/types": "^27.5.1",
"@sinonjs/fake-timers": "^8.0.1",
"@sinonjs/fake-timers": "^9.1.0",
"@types/node": "*",
"jest-message-util": "^27.5.1",
"jest-mock": "^27.5.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/jest-repl/package.json
Expand Up @@ -29,10 +29,10 @@
"jest-util": "^27.5.1",
"jest-validate": "^27.5.1",
"repl": "^0.1.3",
"yargs": "^16.2.0"
"yargs": "^17.3.1"
},
"devDependencies": {
"@types/yargs": "^16.0.0",
"@types/yargs": "^17.0.8",
"execa": "^5.0.0"
},
"bin": {
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-repl/src/__tests__/jest_repl.test.js
Expand Up @@ -9,7 +9,7 @@
import {spawnSync} from 'child_process';
import path from 'path';

const JEST_RUNTIME = path.resolve(__dirname, '../../bin/jest-repl.js');
const JEST_RUNTIME = require.resolve('../../bin/jest-repl.js');

describe('Repl', () => {
describe('cli', () => {
Expand Down
7 changes: 1 addition & 6 deletions packages/jest-repl/src/cli/args.ts
Expand Up @@ -11,7 +11,7 @@ import type {Options} from 'yargs';
export const usage = 'Usage: $0 [--config=<pathToConfigFile>]';

const runtimeCLIOptions: Record<
'cache' | 'config' | 'debug' | 'version' | 'watchman',
'cache' | 'config' | 'debug' | 'watchman',
Options
> = {
cache: {
Expand All @@ -30,11 +30,6 @@ const runtimeCLIOptions: Record<
description: 'Print debugging info about your jest config.',
type: 'boolean',
},
version: {
alias: 'v',
description: 'Print the version and exit',
type: 'boolean',
},
watchman: {
default: true,
description:
Expand Down
9 changes: 5 additions & 4 deletions packages/jest-repl/src/cli/index.ts
Expand Up @@ -15,14 +15,15 @@ import * as args from './args';
import {run as runtimeCLI} from './runtime-cli';
import {VERSION} from './version';

const REPL_SCRIPT = require.resolve('./repl.js');
const REPL_SCRIPT = require.resolve('./repl');

export function run(): void {
const argv = <Config.Argv>yargs.usage(args.usage).options(args.options).argv;
export function run(): Promise<void> {
const argv = yargs.usage(args.usage).options(args.options)
.argv as Config.Argv;

validateCLIOptions(argv, {...args.options, deprecationEntries});

argv._ = [REPL_SCRIPT];

runtimeCLI(argv, [`Jest REPL v${VERSION}`]);
return runtimeCLI(argv, [`Jest REPL v${VERSION}`]);
}
2 changes: 1 addition & 1 deletion packages/jest-reporters/package.json
Expand Up @@ -49,7 +49,7 @@
"@types/istanbul-lib-source-maps": "^4.0.0",
"@types/istanbul-reports": "^3.0.0",
"@types/node-notifier": "^8.0.0",
"mock-fs": "^4.4.1",
"mock-fs": "^5.1.2",
"strip-ansi": "^6.0.0"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-transform/package.json
Expand Up @@ -31,7 +31,7 @@
"pirates": "^4.0.4",
"slash": "^3.0.0",
"source-map": "^0.6.1",
"write-file-atomic": "^3.0.0"
"write-file-atomic": "^4.0.0"
},
"devDependencies": {
"@jest/test-utils": "^27.5.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-types/package.json
Expand Up @@ -23,7 +23,7 @@
"@types/istanbul-lib-coverage": "^2.0.0",
"@types/istanbul-reports": "^3.0.0",
"@types/node": "*",
"@types/yargs": "^16.0.0",
"@types/yargs": "^17.0.8",
"chalk": "^4.0.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-validate/package.json
Expand Up @@ -25,7 +25,7 @@
"pretty-format": "^27.5.1"
},
"devDependencies": {
"@types/yargs": "^16.0.0"
"@types/yargs": "^17.0.8"
},
"engines": {
"node": "^12.13.0 || ^14.15.0 || ^16.13.0 || >=17.0.0"
Expand Down
1 change: 0 additions & 1 deletion website/package.json
Expand Up @@ -34,7 +34,6 @@
"@docusaurus/plugin-pwa": "0.0.0-4269",
"@docusaurus/preset-classic": "0.0.0-4269",
"clsx": "^1.1.1",
"fs-extra": "^9.0.1",
"globby": "^11.0.1",
"react": "^17.0.1",
"react-dom": "^17.0.1",
Expand Down