aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/blacklister-test.js
blob: 1badc2c8ff3873f3215c0c1d0ea6a54b5a2e6abd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const assert = require('assert')
const isPhish = require('../../app/scripts/lib/is-phish')

describe('blacklister', function () {
  describe('#isPhish', function () {
    it('should not flag whitelisted values', function () {
      var result = isPhish({ hostname: 'www.metamask.io' })
      assert(!result)
    })
    it('should flag explicit values', function () {
      var result = isPhish({ hostname: 'metamask.com' })
      assert(result)
    })
    it('should flag levenshtein values', function () {
      var result = isPhish({ hostname: 'metmask.com' })
      assert(result)
    })
    it('should not flag not-even-close values', function () {
      var result = isPhish({ hostname: 'example.com' })
      assert(!result)
    })
  })
})