Add tests for Redirect getters & setters.

This commit is contained in:
Bauke 2022-10-18 22:52:23 +02:00
parent 89751faad2
commit 3fe297b8f1
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
1 changed files with 14 additions and 0 deletions

View File

@ -104,3 +104,17 @@ test('Narrow match & redirect types', (t) => {
t.true(matcherTypes.every((value) => narrowMatchType(value))); t.true(matcherTypes.every((value) => narrowMatchType(value)));
t.true(redirectTypes.every((value) => narrowRedirectType(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);
}
});