Skip to content

Commit 3cabbd5

Browse files
robhoganfacebook-github-bot
authored andcommitted
Fix Windows CI (#1669)
Summary: Pull Request resolved: #1669 Differential Revision: D96358393
1 parent be5222f commit 3cabbd5

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

packages/metro/src/DeltaBundler/__tests__/DeltaCalculator-context-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ describe('DeltaCalculator + require.context', () => {
6464

6565
beforeEach(async () => {
6666
fileWatcher = new EventEmitter();
67-
emitChange = createEmitChange(fileWatcher, '/');
67+
emitChange = createEmitChange(fileWatcher, '/', '/');
6868

6969
markModifiedContextModules.mockImplementation(function <T>(
7070
this: Graph<T>,

packages/metro/src/DeltaBundler/__tests__/test-utils.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
import type EventEmitter from 'events';
1313

14+
import path from 'path';
15+
1416
export type FileEntry =
1517
| string
1618
| [string, {isSymlink?: boolean, modifiedTime?: number}];
@@ -27,8 +29,8 @@ export type ChangeEventInput = {
2729
*/
2830
export function createEmitChange(
2931
fileWatcher: EventEmitter,
30-
rootDir: string,
31-
pathSeparator: string = '/',
32+
rootDir: string = process.platform === 'win32' ? 'C:\\' : '/',
33+
pathSeparator: string = path.sep,
3234
): (changes: ChangeEventInput) => void {
3335
return function emitChange(changes: ChangeEventInput): void {
3436
const toEntry = (

scripts/__tests__/ts-defs-sync-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ test('TypeScript defs are in sync (yarn run build-ts-defs produces no changes)',
2828
expect(error.errors).toEqual([]);
2929
}
3030
expect(error).toBeUndefined();
31-
}, 30000);
31+
}, 60000);

0 commit comments

Comments
 (0)