Skip to content

Commit

Permalink
Make assembler_spec not flaky
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeagle committed Feb 6, 2019
1 parent e2203a9 commit ce45c20
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions internal/web_package/assembler_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ const fs = require('fs');

describe('assembler', () => {
const outdir = 'output';
let testCount = 0;
beforeEach(() => {
const now = Date.now();
// prevent test isolation failures by running each spec in a separate dir
const uniqueDir = path.join(process.env['TEST_TMPDIR'], String(now));
fs.mkdirSync(uniqueDir);
process.chdir(uniqueDir);
fs.mkdirSync('path');
fs.mkdirSync('path/to');
fs.writeFileSync('path/to/thing1.txt', 'some content', {encoding: 'utf-8'});

const now = Date.now() + String(testCount++);
// prevent test isolation failures by running each spec in a separate dir
const uniqueDir = path.join(process.env['TEST_TMPDIR'], String(now));
fs.mkdirSync(uniqueDir);
process.chdir(uniqueDir);
fs.mkdirSync('path');
fs.mkdirSync('path/to');
fs.writeFileSync('path/to/thing1.txt', 'some content', {encoding: 'utf-8'});
});

it('should copy files', () => {
Expand Down

0 comments on commit ce45c20

Please sign in to comment.