本文整理匯總了TypeScript中mocha.after函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript after函數的具體用法?TypeScript after怎麽用?TypeScript after使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了after函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: describe
describe("Model Spec", function () {
let connectionString = config.mongodb;
beforeEach(() => {
delete mongoose.connection.models['Example'];
});
before(() => {
mongoose.Promise = global.Promise;
mongoose.connect(connectionString, {
useMongoClient : true
});
});
it('Can save a new model', async () => {
var example = new Example();
example.name = 'test';
var response = await example.save();
assert.isNotNull(response._id);
})
after(() => {
Example.collection.drop();
})
});
示例2: describe
describe("Remote", () => {
let server;
before(async () => {
server = await runWSServer();
});
after(() => server.close());
defineTestsFor("Remote HTTP messaging", () => createHTTPConnector("http://localhost:" + server.address().port));
defineTestsFor("Remote WebSocket messaging", () =>
createWSConnector(W3CWebSocket)(`ws://localhost:` + server.address().port)
);
});
示例3: describeModule
describeModule('component:x-foo', 'TestModule callbacks', function() {
before(function() {
class I18n extends Ember.Object {}
this.skip();
this.timeout(1000);
this.registry.register('helper:i18n', I18n);
this.registry.register('helper:i18n', I18n, { singleton: true });
this.register('service:i18n', {});
this.inject.service('i18n');
this.inject.service('i18n', { as: 'i18n' });
this.factory('object:user').create();
});
after(function() {
});
beforeEach(function() {
});
afterEach(function() {
});
});