Update tests to include Matcher.
This commit is contained in:
parent
5888dfdc97
commit
b9a56fe881
|
@ -6,16 +6,19 @@ import {
|
||||||
parseRedirect,
|
parseRedirect,
|
||||||
HostnameRedirect,
|
HostnameRedirect,
|
||||||
Redirect,
|
Redirect,
|
||||||
|
Redirects,
|
||||||
RedirectParameters,
|
RedirectParameters,
|
||||||
} from '../source/redirect/exports.js';
|
} from '../source/redirect/exports.js';
|
||||||
|
|
||||||
test('parseRedirect', (t) => {
|
test('parseRedirect', (t) => {
|
||||||
const samples: RedirectParameters[] = [
|
const samples: Array<Redirects['parameters']> = [
|
||||||
{
|
{
|
||||||
test: 'Invalid parameters',
|
test: 'Invalid parameters',
|
||||||
} as unknown as RedirectParameters,
|
} as unknown as Redirects['parameters'],
|
||||||
{
|
{
|
||||||
hostname: 'example.org',
|
hostname: 'example.org',
|
||||||
|
matchType: 'hostname',
|
||||||
|
toMatch: 'example.com',
|
||||||
type: 'hostname',
|
type: 'hostname',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
@ -33,6 +36,8 @@ test('parseRedirect', (t) => {
|
||||||
|
|
||||||
test('Redirect.redirect', (t) => {
|
test('Redirect.redirect', (t) => {
|
||||||
const hostnameRedirect = new HostnameRedirect({
|
const hostnameRedirect = new HostnameRedirect({
|
||||||
|
matchType: 'hostname',
|
||||||
|
toMatch: 'example.com',
|
||||||
hostname: 'example.org',
|
hostname: 'example.org',
|
||||||
type: 'hostname',
|
type: 'hostname',
|
||||||
});
|
});
|
||||||
|
|
|
@ -11,6 +11,8 @@ Generated by [AVA](https://avajs.dev).
|
||||||
HostnameRedirect {
|
HostnameRedirect {
|
||||||
parameters: {
|
parameters: {
|
||||||
hostname: 'example.org',
|
hostname: 'example.org',
|
||||||
|
matchType: 'hostname',
|
||||||
|
toMatch: 'example.com',
|
||||||
type: 'hostname',
|
type: 'hostname',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue