diff --git a/tests/redirect.test.ts b/tests/redirect.test.ts index d2edb9d..ac64f9b 100644 --- a/tests/redirect.test.ts +++ b/tests/redirect.test.ts @@ -104,3 +104,17 @@ test('Narrow match & redirect types', (t) => { t.true(matcherTypes.every((value) => narrowMatchType(value))); t.true(redirectTypes.every((value) => narrowRedirectType(value))); }); + +test('Redirect getters & setters', (t) => { + const samples: Array<[Redirects, string]> = [ + [new HostnameRedirect(hostnameParameters), hostnameParameters.hostname], + [new SimpleRedirect(simpleParameters), simpleParameters.target], + ]; + + for (const [redirect, value] of samples) { + t.is(redirect.redirectValue, value); + const newValue = `${value} test`; + redirect.redirectValue = newValue; + t.is(redirect.redirectValue, newValue); + } +});