mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Add test for blacklister.
This commit is contained in:
parent
f23efec3e3
commit
6a9d40c558
24
test/unit/blacklister-test.js
Normal file
24
test/unit/blacklister-test.js
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
const assert = require('assert')
|
||||||
|
const Blacklister = require('../../app/scripts/blacklister')
|
||||||
|
|
||||||
|
|
||||||
|
describe('blacklister', function () {
|
||||||
|
describe('#isPhish', function () {
|
||||||
|
it('should not flag whitelisted values', function () {
|
||||||
|
var result = Blacklister('www.metamask.io')
|
||||||
|
assert(!result)
|
||||||
|
})
|
||||||
|
it('should flag explicit values', function () {
|
||||||
|
var result = Blacklister('metamask.com')
|
||||||
|
assert(result)
|
||||||
|
})
|
||||||
|
it('should flag levenshtein values', function () {
|
||||||
|
var result = Blacklister('metmask.io')
|
||||||
|
assert(result)
|
||||||
|
})
|
||||||
|
it('should not flag not-even-close values', function () {
|
||||||
|
var result = Blacklister('example.com')
|
||||||
|
assert(!result)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
Loading…
Reference in New Issue
Block a user