Files
browser-wakatime/tests/helpers/contains.spec.js
Vu Nguyen 9ef655ac3b Setup CI tests (#100)
* use @xarc/xrun to streamline tasks in an imperative manner

* add lint-staged/husky for git hook tasks

* run prettier across all files

* fixing tests

* add ci test workflow

* add a ci workflow

* remove precommit in favor of husky

* add .prettierrc.js

* reformat with prettier
2021-01-13 21:05:05 -08:00

25 lines
669 B
JavaScript

var chai = require('chai');
var expect = chai.expect;
var contains = require('../../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 = 'localhost2\ntest.com';
var url = 'http://localhost/fooapp';
expect(contains(url, list)).to.equal(false);
});
});