From a4b12334c5414bc353f0f656a4e71a1e61e18f66 Mon Sep 17 00:00:00 2001 From: Bauke Date: Tue, 18 Oct 2022 21:54:47 +0200 Subject: [PATCH] Add tests for narrowing match & redirect types. --- tests/redirect.test.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/redirect.test.ts b/tests/redirect.test.ts index d73009a..eeaa61b 100644 --- a/tests/redirect.test.ts +++ b/tests/redirect.test.ts @@ -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))); +});