Update tests to include Matcher.

This commit is contained in:
Bauke 2022-10-13 00:05:10 +02:00
parent 5888dfdc97
commit b9a56fe881
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
3 changed files with 9 additions and 2 deletions

View File

@ -6,16 +6,19 @@ import {
parseRedirect,
HostnameRedirect,
Redirect,
Redirects,
RedirectParameters,
} from '../source/redirect/exports.js';
test('parseRedirect', (t) => {
const samples: RedirectParameters[] = [
const samples: Array<Redirects['parameters']> = [
{
test: 'Invalid parameters',
} as unknown as RedirectParameters,
} as unknown as Redirects['parameters'],
{
hostname: 'example.org',
matchType: 'hostname',
toMatch: 'example.com',
type: 'hostname',
},
];
@ -33,6 +36,8 @@ test('parseRedirect', (t) => {
test('Redirect.redirect', (t) => {
const hostnameRedirect = new HostnameRedirect({
matchType: 'hostname',
toMatch: 'example.com',
hostname: 'example.org',
type: 'hostname',
});

View File

@ -11,6 +11,8 @@ Generated by [AVA](https://avajs.dev).
HostnameRedirect {
parameters: {
hostname: 'example.org',
matchType: 'hostname',
toMatch: 'example.com',
type: 'hostname',
},
}