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

Node 10.5.x compatibility on CI for tests #6532

Merged
merged 1 commit into from
Jun 24, 2018
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
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@
const slash = require('slash');

jest
.mock('fs')
.mock('fs', () =>
// Node 10.5.x compatibility
Object.assign({}, jest.genMockFromModule('fs'), {
ReadStream: require.requireActual('fs').ReadStream,
WriteStream: require.requireActual('fs').WriteStream,
}),
)
.mock('graceful-fs')
.mock('jest-haste-map', () => ({
getCacheFilePath: (cacheDir, baseDir, version) => cacheDir + baseDir,
Expand Down
8 changes: 7 additions & 1 deletion packages/jest-util/src/__tests__/get_callsite.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ import fs from 'fs';
import SourceMap from 'source-map';
import getCallsite from '../get_callsite';

jest.mock('fs');
// Node 10.5.x compatibility
jest.mock('fs', () =>
Object.assign({}, jest.genMockFromModule('fs'), {
ReadStream: require.requireActual('fs').ReadStream,
WriteStream: require.requireActual('fs').WriteStream,
}),
);

describe('getCallsite', () => {
test('without source map', () => {
Expand Down