Skip to content

Commit

Permalink
test: try skipping in before()
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Jul 29, 2018
1 parent d5b43da commit 2bf81e7
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions test/docs/transactions.test.js
Expand Up @@ -146,6 +146,11 @@ describe('transactions', function() {
let session;

before(function() {
if (_skipped) {
this.skip();
return; // https://github.com/mochajs/mocha/issues/2546
}

Author = db.model('Author', new Schema({ name: String }), 'Author');
Article = db.model('Article', new Schema({
author: {
Expand All @@ -159,10 +164,6 @@ describe('transactions', function() {
});

beforeEach(function() {
if (_skipped) {
this.skip();
return Promise.resolve(); // https://github.com/mochajs/mocha/issues/2546
}
return Author.deleteMany({}).
then(() => Article.deleteMany({})).
then(() => db.startSession()).
Expand All @@ -173,9 +174,6 @@ describe('transactions', function() {
});

afterEach(function(done) {
if (_skipped) {
return done(); // https://github.com/mochajs/mocha/issues/2546
}
session.commitTransaction();
done();
});
Expand Down

0 comments on commit 2bf81e7

Please sign in to comment.