Skip to content

Commit

Permalink
Improve tests for utils.createAssetsFilter
Browse files Browse the repository at this point in the history
  • Loading branch information
th0r committed May 15, 2018
1 parent a5275a4 commit a6cb49c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ describe('createAssetsFilter', function () {
expect(filter('bar-foo')).to.equal(true);
});

it('should throw on invalid pattern types', function () {
expect(() => createAssetsFilter(5)).to.throw('but "5" got');
expect(() => createAssetsFilter({ a: 1 })).to.throw('but "{ a: 1 }" got');
expect(() => createAssetsFilter([true])).to.throw('but "true" got');
});

it('should allow an array of patterns', function () {
const filter = createAssetsFilter([
'^foo',
Expand Down

0 comments on commit a6cb49c

Please sign in to comment.