Skip to content

Commit cc5b8b4

Browse files
committed
test(pattern-matching): Test to ensure that the MatchesAnything rule matches any input
MatchesAnything is used as a default rule (else) by all the PatternMatchers, so it has to always match any input should other rules could not be matched.
1 parent 3abddb1 commit cc5b8b4

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import 'mocha';
2+
import { given } from 'mocha-testdata';
3+
import { MatchesAnything } from '../../../src/pattern-matching/rules';
4+
import { expect } from '../../expect';
5+
6+
describe('MatchesAnything', () => {
7+
8+
given(
9+
1, false, {},
10+
).
11+
it('is always executed', (input: any) => {
12+
const rule = new MatchesAnything(_ => _);
13+
14+
expect(rule.matches(input)).to.be.true; // tslint:disable-line:no-unused-expression
15+
});
16+
});

0 commit comments

Comments
 (0)