mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-20 01:12:38 +01:00
Merge branch 'master' of https://github.com/gorhill/uBlock
This commit is contained in:
commit
0ec1204d37
@ -39,6 +39,36 @@ process.on('warning', warning => {
|
|||||||
let engine = null;
|
let engine = null;
|
||||||
|
|
||||||
describe('SNFE', () => {
|
describe('SNFE', () => {
|
||||||
|
describe('Initialization', () => {
|
||||||
|
let StaticNetFilteringEngine = null;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
const module = await createWorld('./index.js', { globals: { URL } });
|
||||||
|
|
||||||
|
StaticNetFilteringEngine = module.StaticNetFilteringEngine;
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should not reject on first attempt', async () => {
|
||||||
|
await StaticNetFilteringEngine.create();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should reject on second attempt', async () => {
|
||||||
|
await StaticNetFilteringEngine.create();
|
||||||
|
await assert.rejects(StaticNetFilteringEngine.create());
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should reject on third attempt', async () => {
|
||||||
|
await StaticNetFilteringEngine.create();
|
||||||
|
|
||||||
|
try {
|
||||||
|
await StaticNetFilteringEngine.create();
|
||||||
|
} catch (error) {
|
||||||
|
}
|
||||||
|
|
||||||
|
await assert.rejects(StaticNetFilteringEngine.create());
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe('Filter loading', () => {
|
describe('Filter loading', () => {
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
const globals = { URL, setTimeout, clearTimeout };
|
const globals = { URL, setTimeout, clearTimeout };
|
||||||
|
Loading…
Reference in New Issue
Block a user