Add tests for narrowing match & redirect types.
This commit is contained in:
parent
81669cc535
commit
a4b12334c5
|
@ -3,7 +3,11 @@
|
|||
import test from 'ava';
|
||||
|
||||
import {
|
||||
matcherTypes,
|
||||
narrowMatchType,
|
||||
narrowRedirectType,
|
||||
parseRedirect,
|
||||
redirectTypes,
|
||||
HostnameRedirect,
|
||||
Redirect,
|
||||
Redirects,
|
||||
|
@ -93,3 +97,10 @@ test('Redirect.isMatch', (t) => {
|
|||
}
|
||||
}
|
||||
});
|
||||
|
||||
test('Narrow match & redirect types', (t) => {
|
||||
t.false(narrowMatchType('invalid'));
|
||||
t.false(narrowRedirectType('invalid'));
|
||||
t.true(matcherTypes.every((type) => narrowMatchType(type)));
|
||||
t.true(redirectTypes.every((type) => narrowRedirectType(type)));
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue