Skip to content
/ jest Public
forked from jestjs/jest

Fixes the tests #601

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

Merged
merged 1 commit into from
Jun 24, 2020
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion e2e/pnp/__tests__/undeclared-dependency.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
it('should surface pnp errors', () => {
expect(() => {
require('undeclared');
}).toThrow(expect.objectContaining({code: 'UNDECLARED_DEPENDENCY'}));
}).toThrow(expect.objectContaining({pnpCode: 'UNDECLARED_DEPENDENCY'}));
});
2 changes: 1 addition & 1 deletion packages/jest-resolve/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@jest/types": "^26.1.0",
"chalk": "^4.0.0",
"graceful-fs": "^4.2.4",
"jest-pnp-resolver": "^1.2.1",
"jest-pnp-resolver": "^1.2.2",
"jest-util": "^26.1.0",
"read-pkg-up": "^7.0.1",
"resolve": "^1.17.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/jest-resolve/src/defaultResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {tryRealpath} from 'jest-util';
import type {Config} from '@jest/types';

type ResolverOptions = {
allowPnp?: boolean;
basedir: Config.Path;
browser?: boolean;
defaultResolver: typeof defaultResolver;
Expand All @@ -26,7 +27,7 @@ export default function defaultResolver(
options: ResolverOptions,
): Config.Path {
// @ts-expect-error: the "pnp" version named isn't in DefinitelyTyped
if (process.versions.pnp) {
if (process.versions.pnp && options.allowPnp !== false) {
return pnpResolver(path, options);
}

Expand Down
4 changes: 4 additions & 0 deletions scripts/verifyOldTs.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ const cwd = tempy.directory();
const tsVersion = '3.8';

try {
fs.writeFileSync(
path.join(cwd, '.yarnrc.yml'),
'nodeLinker: node-modules\n',
);
execa.sync('yarn', ['init', '--yes'], {cwd, stdio: 'inherit'});
execa.sync('yarn', ['add', `typescript@~${tsVersion}`], {
cwd,
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11378,15 +11378,15 @@ fsevents@^1.2.7:
languageName: unknown
linkType: soft

"jest-pnp-resolver@npm:^1.2.1":
version: 1.2.1
resolution: "jest-pnp-resolver@npm:1.2.1"
"jest-pnp-resolver@npm:^1.2.2":
version: 1.2.2
resolution: "jest-pnp-resolver@npm:1.2.2"
peerDependencies:
jest-resolve: "*"
peerDependenciesMeta:
jest-resolve:
optional: true
checksum: ab48e45c3985a8ea89dceba6c7867017addb38a6da6121211fb533000207c56e4de1a662c3d5715524e7e3b25faaeaf242c5749a1257aecbd2d9343cbc2ddf04
checksum: d91c86e3899f35ac1a6d40fa29e94212fc9b8e5e70d31d77ff281413441c844ec44a3673a3860f9b2155fed6738548f52eee9e63845e8d5f8550a890533c78cc
languageName: node
linkType: hard

Expand Down Expand Up @@ -11446,7 +11446,7 @@ fsevents@^1.2.7:
chalk: ^4.0.0
graceful-fs: ^4.2.4
jest-haste-map: ^26.1.0
jest-pnp-resolver: ^1.2.1
jest-pnp-resolver: ^1.2.2
jest-util: ^26.1.0
read-pkg-up: ^7.0.1
resolve: ^1.17.0
Expand Down