Skip to content

Commit

Permalink
adding more test assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdothtml committed Dec 30, 2018
1 parent 6878a46 commit 6f7cbc2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ import minimatch from './index.js'
test({
name: 'minimatch',
fn () {
const mmInstance = new minimatch.Minimatch('*.js')

assertEqual(minimatch('bar.foo', '*.foo'), true)
assertEqual(minimatch('bar.foo', '*.+(bar|foo)'), true)
assertEqual(minimatch('bar.foo', '*.bar'), false)
assertEqual(
['foo.js', 'foo.txt'].filter(minimatch.filter('*.js')),
['foo.js']
)
assertEqual(mmInstance.match('foo.js'), true)
assertEqual(mmInstance.makeRe() instanceof RegExp, true)
}
})

0 comments on commit 6f7cbc2

Please sign in to comment.