afterEach(async () => { if (system) { await system.destroy(); } system = null; });
describe('init', () => { afterEach(() => { global.Intl = intlDefault; }); it('polyfills Intl', () => { expect(global.Intl).toBe(intlDefault); init(); expect(global.Intl).toBe(intlPolyfill); }); });
describe('toc-link-plugin', () => { afterEach(() => { global.window.$docsify = {}; delete global.window.Docsify; }); it('installs the plugin', () => { assume(global.window.$docsify).not.property('plugins'); setup(); assume(global.window.$docsify).property('plugins'); global.window.$docsify = {}; }); });
afterEach(() => { request.get.restore(); client.transformRegistry.restore(); client.handleDelta.restore(); });
function silenceErrorLogs(inner: () => void) { describe("(with silent console.error or console.warn)", () => { beforeEach(() => { sinon.stub(console, "error").callsFake(() => {}); sinon.stub(console, "warn").callsFake(() => {}); }); afterEach(() => { (console.error as any).restore(); (console.warn as any).restore(); }); inner(); }); }
afterEach(function (done) { if (mongoDbVoteDatabase) { console.log("Closing Mongo Connection"); mongoDbVoteDatabase.disconnect(function () { console.log(" #### done"); done(); }); return; } done(); });
afterEach(function(done) { tcp.disconnectFrom('127.0.0.1', 4895); fake_server.kill(); setTimeout(done, 500); });
afterEach((done) => { mockery.disable() mockery.deregisterAll() done() })
afterEach(function () { if (JSON.stringify['restore']) JSON.stringify.restore(); });
// Tests ===================================================================== afterEach(function (done) { loadDefaults(); done(); });
afterEach(function () { mockUserDataStore.reset(); mockApiKeyStore.reset(); });
afterEach(() => { registerSpy.restore(); fetchRegistrySpy.restore(); heartbeatsSpy.restore(); registryFetchSpy.restore(); });
afterEach(function () { builder = null; jest.resetAllMocks(); });
afterEach(() => { sendStub.restore(); registryScope.done(); });
afterEach(function () { log = null; sinon.restore(); });