Skip to content

Commit

Permalink
test: more test fixes re: #6754
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Jul 29, 2018
1 parent e91d404 commit d5b43da
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions test/docs/transactions.test.js
Expand Up @@ -160,26 +160,24 @@ describe('transactions', function() {

beforeEach(function() {
if (_skipped) {
return this.skip(); // https://github.com/mochajs/mocha/issues/2546
}
return Author.deleteMany({}).then(() => Article.deleteMany({}));
});

beforeEach(function() {
if (_skipped) {
return this.skip(); // https://github.com/mochajs/mocha/issues/2546
this.skip();
return Promise.resolve(); // https://github.com/mochajs/mocha/issues/2546
}
return db.startSession().then(_session => {
session = _session;
session.startTransaction();
});
return Author.deleteMany({}).
then(() => Article.deleteMany({})).
then(() => db.startSession()).
then(_session => {
session = _session;
session.startTransaction();
});
});

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

it('`populate()` uses the querys session', function() {
Expand Down

0 comments on commit d5b43da

Please sign in to comment.