Skip to content

Commit 2bf81e7

Browse files
committedJul 29, 2018
test: try skipping in before()
1 parent d5b43da commit 2bf81e7

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed
 

‎test/docs/transactions.test.js

+5-7
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,11 @@ describe('transactions', function() {
146146
let session;
147147

148148
before(function() {
149+
if (_skipped) {
150+
this.skip();
151+
return; // https://github.com/mochajs/mocha/issues/2546
152+
}
153+
149154
Author = db.model('Author', new Schema({ name: String }), 'Author');
150155
Article = db.model('Article', new Schema({
151156
author: {
@@ -159,10 +164,6 @@ describe('transactions', function() {
159164
});
160165

161166
beforeEach(function() {
162-
if (_skipped) {
163-
this.skip();
164-
return Promise.resolve(); // https://github.com/mochajs/mocha/issues/2546
165-
}
166167
return Author.deleteMany({}).
167168
then(() => Article.deleteMany({})).
168169
then(() => db.startSession()).
@@ -173,9 +174,6 @@ describe('transactions', function() {
173174
});
174175

175176
afterEach(function(done) {
176-
if (_skipped) {
177-
return done(); // https://github.com/mochajs/mocha/issues/2546
178-
}
179177
session.commitTransaction();
180178
done();
181179
});

0 commit comments

Comments
 (0)
Please sign in to comment.