Skip to content

Commit

Permalink
path test: Make output easier to understand
Browse files Browse the repository at this point in the history
Now, we can see just what the expected/actual difference is, rather than
just getting a -1 vs 0 from an indexOf test.
  • Loading branch information
josephfrazier committed Apr 19, 2017
1 parent 362f71a commit 517d7df
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions __tests__/commands/pack.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,14 @@ test.concurrent('pack should inlude all files listed in the files array', (): Pr
path.join(cwd, 'files-include-v1.0.0.tgz'),
path.join(cwd, 'files-include-v1.0.0'),
);
const expected = ['index.js', 'a.js', 'b.js', path.join('dir', 'nested.js')];
expected.forEach((filename) => {
expect(files.indexOf(filename)).toBeGreaterThanOrEqual(0);
});
expect(files.sort()).toEqual([
'a.js',
'b.js',
'dir',
path.join('dir', 'nested.js'),
'index.js',
'package.json',
]);
});
});

Expand Down

0 comments on commit 517d7df

Please sign in to comment.