Files
browser-wakatime/tests/helpers/contains.spec.js
Alan Hamlett 53b60eb90e fix blacklist
2016-06-29 11:11:22 -07:00

27 lines
726 B
JavaScript

var chai = require('chai');
var expect = chai.expect;
import contains from '../../assets/js/helpers/contains';
describe('contains', function() {
it('should be a function', function() {
expect(contains).to.be.a('function');
});
it('should match url against blacklist and return true', function() {
var list = "localhost\ntest.com";
var url = 'http://localhost/fooapp';
expect(contains(url, list)).to.equal(true);
});
it('should not match url against blacklist and return false', function() {
var list = "localhost\ntest.com";
var url = 'http://localhost/fooapp';
expect(contains('http://localhost2/fooapp', list)).to.equal(false);
});
});