Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Promisify test object creation/destruction #1773

Closed
aanev opened this issue May 11, 2017 · 1 comment
Closed

Promisify test object creation/destruction #1773

aanev opened this issue May 11, 2017 · 1 comment

Comments

@aanev
Copy link
Contributor

aanev commented May 11, 2017

I guess it might be a good idea to promisify object creation/destruction in the tests. For example:

 afterEach(function (done) {
    User.remove().exec(function () {
      Article.remove().exec(done);
    });
  });

can become:

  afterEach(function (done) {
    User.remove().exec()
      .then(Article.remove().exec())
      .then(done());
  });

This can simplify more complex test scenarios where multiple models are used.

@mleanos
Copy link
Member

mleanos commented May 15, 2017

Good idea. A PR would be very welcome for your proposed changes. Thanks you.

@mleanos mleanos self-assigned this May 15, 2017
lirantal pushed a commit that referenced this issue Jun 12, 2017
…1774)

Promisifies object creation in beforeEach and afterEach hooks in article server tests.

Fixes #1773
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants