本文整理汇总了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();
});