Skip to content

Instantly share code, notes, and snippets.

@the-vampiire
Created November 12, 2018 22:15
Show Gist options
  • Select an option

  • Save the-vampiire/0f95717aef1b5faf219b517c5b85f4a2 to your computer and use it in GitHub Desktop.

Select an option

Save the-vampiire/0f95717aef1b5faf219b517c5b85f4a2 to your computer and use it in GitHub Desktop.
fixing mongoose disconnect using Jest
describe('User.formSubmit() Mutation', () => {
beforeAll(async (done) => {
await mongoose.connect(`${MONGO_URI}${MONGO_DB}`, { useNewUrlParser: true });
done();
});
afterAll(async (done) => {
await mongoose.disconnect();
done();
});
test('suite setup ready', () => {
// removed for brevity
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment