Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
fortuna committed Nov 8, 2024
1 parent bff0b05 commit fe47a77
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
ServersStorageV1,
serversStorageV0ConfigToAccessKey,
} from '.';
import * as config from './config';
import {OutlineServer} from './server';
import {FakeVpnApi} from './vpn.fake';
import {
Expand Down Expand Up @@ -341,13 +342,13 @@ describe('OutlineServerRepository', () => {
it('validates static access keys', () => {
const repo = newTestRepo(new EventQueue(), new InMemoryStorage());
// Invalid access keys.
expect(() => repo.validateAccessKey('')).toThrowError(ServerUrlInvalid);
expect(() => repo.validateAccessKey('ss://invalid')).toThrowError(
expect(() => config.validateAccessKey('')).toThrowError(ServerUrlInvalid);
expect(() => config.validateAccessKey('ss://invalid')).toThrowError(
ServerUrlInvalid
);
// IPv6 host.
expect(() =>
repo.validateAccessKey(
config.validateAccessKey(
SIP002_URI.stringify(
makeConfig({
host: '2001:0:ce49:7601:e866:efff:62c3:fffe',
Expand All @@ -360,7 +361,7 @@ describe('OutlineServerRepository', () => {
).toBeTruthy();
// Unsupported ciphers.
expect(() =>
repo.validateAccessKey(
config.validateAccessKey(
SIP002_URI.stringify(
makeConfig({
host: '127.0.0.1',
Expand All @@ -372,7 +373,7 @@ describe('OutlineServerRepository', () => {
)
).toThrowError(ShadowsocksUnsupportedCipher);
expect(() =>
repo.validateAccessKey(
config.validateAccessKey(
SIP002_URI.stringify(
makeConfig({
host: '127.0.0.1',
Expand Down

0 comments on commit fe47a77

Please sign in to comment.