Add enabled local routing rules and gateway version reporting
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
|
||||
import { normalizeRouteRules } from '../../src/shared/routingRules.js';
|
||||
import { canAppendRouteRule, normalizeRouteRules } from '../../src/shared/routingRules.js';
|
||||
|
||||
test('local route rules normalize URLs, suffixes and duplicates', () => {
|
||||
assert.deepEqual(normalizeRouteRules([
|
||||
@@ -9,12 +9,15 @@ test('local route rules normalize URLs, suffixes and duplicates', () => {
|
||||
{ type: 'domain_suffix', value: '*.Example.org' },
|
||||
{ type: 'domain_keyword', value: ' CDN ' },
|
||||
{ type: 'domain', value: 'example.com' },
|
||||
{ type: 'domain_suffix', value: '.ru' },
|
||||
{ type: 'domain_suffix', value: '.ru', enabled: false },
|
||||
], { strict: true }), [
|
||||
{ type: 'domain', value: 'example.com' },
|
||||
{ type: 'domain_suffix', value: 'example.org' },
|
||||
{ type: 'domain_keyword', value: 'cdn' },
|
||||
{ type: 'domain', value: 'example.com', enabled: true },
|
||||
{ type: 'domain_suffix', value: 'example.org', enabled: true },
|
||||
{ type: 'domain_keyword', value: 'cdn', enabled: true },
|
||||
{ type: 'domain_suffix', value: 'ru', enabled: false },
|
||||
]);
|
||||
assert.equal(canAppendRouteRule([{ value: 'filled' }]), true);
|
||||
assert.equal(canAppendRouteRule([{ value: '' }]), false);
|
||||
});
|
||||
|
||||
test('invalid local route rules fail at the strict boundary', () => {
|
||||
|
||||
Reference in New Issue
Block a user