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

fix(jest-config): add missing slash dependency #12080

Merged
merged 6 commits into from
Nov 24, 2021
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
### Fixes

- `[expect]` Allow again `expect.Matchers` generic with single value ([#11986](https://github.com/facebook/jest/pull/11986))
- `[jest-config]` Add missing `slash` dependency to `package.json` ([#12080](https://github.com/facebook/jest/pull/12080))
- `[jest-core]` Incorrect detection of open ZLIB handles ([#12022](https://github.com/facebook/jest/pull/12022))
- `[jest-diff]` Break dependency cycle ([#10818](https://github.com/facebook/jest/pull/10818))
- `[jest-environment-jsdom]` Add `@types/jsdom` dependency ([#11999](https://github.com/facebook/jest/pull/11999))
Expand Down
3 changes: 2 additions & 1 deletion packages/jest-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
"jest-util": "^27.3.1",
"jest-validate": "^27.3.1",
"micromatch": "^4.0.4",
"pretty-format": "^27.3.1"
"pretty-format": "^27.3.1",
"slash": "^4.0.0"
SimenB marked this conversation as resolved.
Show resolved Hide resolved
},
"devDependencies": {
"@types/babel__core": "^7.0.4",
Expand Down
6 changes: 5 additions & 1 deletion packages/jest-config/src/resolveConfigPath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import * as path from 'path';
import chalk = require('chalk');
import * as fs from 'graceful-fs';
import slash = require('slash');
import slashModule = require('slash');
SimenB marked this conversation as resolved.
Show resolved Hide resolved
import type {Config} from '@jest/types';
import {
JEST_CONFIG_BASE_NAME,
Expand All @@ -21,6 +21,10 @@ const isFile = (filePath: Config.Path) =>

const getConfigFilename = (ext: string) => JEST_CONFIG_BASE_NAME + ext;

// Fix incorrect TypeScript definition for `slash` package.
const slash: typeof slashModule.default =
slashModule as unknown as typeof slashModule.default;

SimenB marked this conversation as resolved.
Show resolved Hide resolved
export default (
pathToResolve: Config.Path,
cwd: Config.Path,
Expand Down
8 changes: 8 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12658,6 +12658,7 @@ fsevents@^1.2.7:
micromatch: ^4.0.4
pretty-format: ^27.3.1
semver: ^7.3.5
slash: ^4.0.0
SimenB marked this conversation as resolved.
Show resolved Hide resolved
strip-ansi: ^6.0.0
ts-node: ^9.0.0
typescript: ^4.0.3
Expand Down Expand Up @@ -19641,6 +19642,13 @@ [email protected]:
languageName: node
linkType: hard

"slash@npm:^4.0.0":
version: 4.0.0
resolution: "slash@npm:4.0.0"
checksum: 714b10473dd5efce5ebaad47c74d69201baf7715fa58e8049d3d2716d9da25a9571bfd3ecc50c3b7f4165948e2d8d5a1aa7faeaeca4891ee71a2fbd408268091
languageName: node
linkType: hard

SimenB marked this conversation as resolved.
Show resolved Hide resolved
"slice-ansi@npm:^2.0.0":
version: 2.1.0
resolution: "slice-ansi@npm:2.1.0"
Expand Down