本文整理匯總了TypeScript中mockery.disable函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript disable函數的具體用法?TypeScript disable怎麽用?TypeScript disable使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了disable函數的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: before
before(() => {
mockery.disable(); // needed to ensure that we can mock vsts-task-lib/task
mockery.enable({
useCleanCache: true,
warnOnUnregistered: false
} as mockery.MockeryEnableArgs);
});
示例2: destroy
destroy(): void {
unload(this.moduleUnderTestPath);
Object.keys(this.mocks)
.map((dep) => resolvePath(this.basePath, dep))
.map((dep) => unload(dep));
this.sandbox.restore();
mockery.deregisterAll();
mockery.disable();
}
示例3: teardown
teardown(() => {
testUtils.removeUnhandledRejectionListener();
mockery.deregisterAll();
mockery.disable();
});
示例4: afterEach
afterEach(function () {
mockery.deregisterAll();
mockery.disable();
});
示例5: require
'setup'() {
mockery.enable({
warnOnUnregistered: false
});
mockery.registerMock('update-notifier', updateNotifierStub);
updateNotifier = require('intern/dojo/node!./../../src/updateNotifier').default;
},
'beforeEach'() {
notifyStub.reset();
updateNotifierStub.reset();
},
'teardown'() {
mockery.deregisterAll();
mockery.disable();
},
'Should call update-notifier with the passed arguments'() {
updateNotifier(testPkg, testInterval);
assert.isTrue(updateNotifierStub.calledOnce);
assert.isTrue(updateNotifierStub.firstCall.calledWith({
'pkg': testPkg,
'updateCheckInterval': testInterval
}));
},
'Should default interval to zero if none passed'() {
updateNotifier(testPkg);
assert.isTrue(updateNotifierStub.calledOnce);
assert.isTrue(updateNotifierStub.firstCall.calledWith({
'pkg': testPkg,
'updateCheckInterval': 0
示例6: after
after(function () {
mockery.disable();
});
示例7: afterEach
afterEach(function () {
sandbox.restore();
mockery.deregisterAll();
mockery.disable();
});
示例8: afterEach
afterEach(function () {
setVersion(originalVersion);
mockery.disable();
});
示例10: after
after(() => {
tl.mkdirP.restore();
mockery.deregisterAll();
mockery.disable();
});