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 test from 'ava';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
matcherTypes,
|
||||||
|
narrowMatchType,
|
||||||
|
narrowRedirectType,
|
||||||
parseRedirect,
|
parseRedirect,
|
||||||
|
redirectTypes,
|
||||||
HostnameRedirect,
|
HostnameRedirect,
|
||||||
Redirect,
|
Redirect,
|
||||||
Redirects,
|
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