Skip to content

Commit

Permalink
Fix test failures introduced by making code more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Partington committed Jun 17, 2020
1 parent 24096a1 commit 14d602c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions lib/config-utils.test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/config-utils.test.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src/config-utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,21 +100,21 @@ test("load non-empty input", async t => {
paths:
- c/d`;

fs.mkdirSync(path.join(tmpDir, 'foo'));

// And the config we expect it to parse to
const expectedConfig = new configUtils.Config();
expectedConfig.name = 'my config';
expectedConfig.disableDefaultQueries = true;
expectedConfig.additionalQueries.push(tmpDir);
expectedConfig.additionalQueries.push(path.join(tmpDir, 'foo'));
expectedConfig.additionalQueries.push(fs.realpathSync(tmpDir));
expectedConfig.additionalQueries.push(fs.realpathSync(path.join(tmpDir, 'foo')));
expectedConfig.externalQueries = [new configUtils.ExternalQuery('foo/bar', 'dev')];
expectedConfig.pathsIgnore = ['a', 'b'];
expectedConfig.paths = ['c/d'];

fs.writeFileSync(path.join(tmpDir, 'input'), inputFileContents, 'utf8');
setInput('config-file', 'input');

fs.mkdirSync(path.join(tmpDir, 'foo'));

const actualConfig = await configUtils.loadConfig();

// Should exactly equal the object we constructed earlier
Expand Down

0 comments on commit 14d602c

Please sign in to comment.