build: enable JS semicolons (#22783)
This commit is contained in:
parent
24e21467b9
commit
5d657dece4
354 changed files with 21512 additions and 21510 deletions
|
@ -1,47 +1,47 @@
|
|||
import { expect } from 'chai'
|
||||
import { CallbacksRegistry } from '../lib/renderer/remote/callbacks-registry'
|
||||
import { ifdescribe } from './spec-helpers'
|
||||
import { expect } from 'chai';
|
||||
import { CallbacksRegistry } from '../lib/renderer/remote/callbacks-registry';
|
||||
import { ifdescribe } from './spec-helpers';
|
||||
|
||||
const features = process.electronBinding('features')
|
||||
const features = process.electronBinding('features');
|
||||
|
||||
ifdescribe(features.isRemoteModuleEnabled())('CallbacksRegistry module', () => {
|
||||
let registry: CallbacksRegistry
|
||||
let registry: CallbacksRegistry;
|
||||
|
||||
beforeEach(() => {
|
||||
registry = new CallbacksRegistry()
|
||||
})
|
||||
registry = new CallbacksRegistry();
|
||||
});
|
||||
|
||||
it('adds a callback to the registry', () => {
|
||||
const cb = () => [1, 2, 3, 4, 5]
|
||||
const key = registry.add(cb)
|
||||
const cb = () => [1, 2, 3, 4, 5];
|
||||
const key = registry.add(cb);
|
||||
|
||||
expect(key).to.exist('key')
|
||||
})
|
||||
expect(key).to.exist('key');
|
||||
});
|
||||
|
||||
it('returns a specified callback if it is in the registry', () => {
|
||||
const cb = () => [1, 2, 3, 4, 5]
|
||||
const key = registry.add(cb)
|
||||
expect(key).to.exist('key')
|
||||
const callback = registry.get(key!)
|
||||
const cb = () => [1, 2, 3, 4, 5];
|
||||
const key = registry.add(cb);
|
||||
expect(key).to.exist('key');
|
||||
const callback = registry.get(key!);
|
||||
|
||||
expect(callback.toString()).equal(cb.toString())
|
||||
})
|
||||
expect(callback.toString()).equal(cb.toString());
|
||||
});
|
||||
|
||||
it('returns an empty function if the cb doesnt exist', () => {
|
||||
const callback = registry.get(1)
|
||||
const callback = registry.get(1);
|
||||
|
||||
expect(callback).to.be.a('function')
|
||||
})
|
||||
expect(callback).to.be.a('function');
|
||||
});
|
||||
|
||||
it('removes a callback to the registry', () => {
|
||||
const cb = () => [1, 2, 3, 4, 5]
|
||||
const key = registry.add(cb)
|
||||
expect(key).to.exist('key')
|
||||
const cb = () => [1, 2, 3, 4, 5];
|
||||
const key = registry.add(cb);
|
||||
expect(key).to.exist('key');
|
||||
|
||||
registry.remove(key!)
|
||||
const afterCB = registry.get(key!)
|
||||
registry.remove(key!);
|
||||
const afterCB = registry.get(key!);
|
||||
|
||||
expect(afterCB).to.be.a('function')
|
||||
expect(afterCB.toString()).to.not.equal(cb.toString())
|
||||
})
|
||||
})
|
||||
expect(afterCB).to.be.a('function');
|
||||
expect(afterCB.toString()).to.not.equal(cb.toString());
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue