Skip to content

Commit

Permalink
windows test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Aug 31, 2019
1 parent 382df36 commit 0b9d35c
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions e2e/__tests__/transform.test.ts
Expand Up @@ -187,23 +187,21 @@ describe('transformer-config', () => {
});

describe('transformer caching', () => {
const dir = path.resolve(__dirname, '..', 'transform/cache');
const dirRegexp = new RegExp('^' + dir);
const dir = path.resolve(__dirname, '../transform/cache');
const transformedFile = path.resolve(dir, './common-file.js');

it('does not rerun transform within worker', () => {
// --no-cache because babel can cache stuff and result in false green
const {stdout} = runJest(dir, ['--no-cache', '-w=2']);

const loggedFiles = stdout.split('\n').map(line => {
expect(line).toMatch(dirRegexp);
const loggedFiles = stdout.split('\n');

return line.replace(dirRegexp, '<rootDir>');
// Verify any lines logged are _just_ the file we care about
loggedFiles.forEach(line => {
expect(line).toBe(transformedFile);
});

// We run with 2 workers, so the file should be transformed twice
expect(loggedFiles).toEqual([
'<rootDir>/common-file.js',
'<rootDir>/common-file.js',
]);
expect(loggedFiles).toHaveLength(2);
});
});

0 comments on commit 0b9d35c

Please sign in to comment.