-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Pass
watchPathIgnorePatterns
to Haste instance (#7585)
- Loading branch information
Showing
6 changed files
with
52 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
packages/jest-runtime/src/__tests__/Runtime-statics.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
*/ | ||
|
||
import HasteMap from 'jest-haste-map'; | ||
const Runtime = require('../'); | ||
|
||
jest.mock('jest-haste-map'); | ||
|
||
describe('Runtime statics', () => { | ||
const projectConfig = { | ||
cacheDirectory: '/tmp', | ||
haste: {}, | ||
modulePathIgnorePatterns: ['/root/ignore-1', '/root/ignore-2'], | ||
watchPathIgnorePatterns: ['/watch-root/ignore-1'], | ||
}; | ||
const options = {}; | ||
|
||
beforeEach(() => { | ||
jest.clearAllMocks(); | ||
}); | ||
|
||
test('Runtime.createHasteMap passes correct ignore files to HasteMap', () => { | ||
Runtime.createHasteMap(projectConfig, options); | ||
expect(HasteMap).toBeCalledWith( | ||
expect.objectContaining({ | ||
ignorePattern: /\/root\/ignore-1|\/root\/ignore-2/, | ||
}), | ||
); | ||
}); | ||
|
||
test('Runtime.createHasteMap passes correct ignore files to HasteMap in watch mode', () => { | ||
Runtime.createHasteMap(projectConfig, {...options, watch: true}); | ||
expect(HasteMap).toBeCalledWith( | ||
expect.objectContaining({ | ||
ignorePattern: /\/root\/ignore-1|\/root\/ignore-2|\/watch-root\/ignore-1/, | ||
watch: true, | ||
}), | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters