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