Skip to content

Commit

Permalink
test: add happy path case for validateConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
mikesposito committed Jun 5, 2024
1 parent 015fbd0 commit dda4d9e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/phishing-controller/src/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,17 @@ describe('applyDiffs', () => {
});

describe('validateConfig', () => {
it('correctly validates a valid config', () => {
expect(() =>
validateConfig({
allowlist: ['example.com'],
blocklist: ['sub.example.com'],
fuzzylist: ['fuzzy.example.com'],
tolerance: 2,
}),
).not.toThrow();
});

it('throws an error if the config is not an object', () => {
expect(() => validateConfig(null)).toThrow('Invalid config');
});
Expand Down

0 comments on commit dda4d9e

Please sign in to comment.