Skip to content

Commit

Permalink
docs: put before/afterAll into describe block
Browse files Browse the repository at this point in the history
  • Loading branch information
vladholubiev committed Apr 12, 2019
1 parent 1a86789 commit 4efd29f
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,19 @@ module.exports = {
```js
const {MongoClient} = require('mongodb');

let connection;
let db;

beforeAll(async () => {
connection = await MongoClient.connect(global.__MONGO_URI__, {useNewUrlParser: true});
db = await connection.db(global.__MONGO_DB_NAME__);
});

afterAll(async () => {
await connection.close();
await db.close();
describe('insert', () => {
let connection;
let db;

beforeAll(async () => {
connection = await MongoClient.connect(global.__MONGO_URI__, {useNewUrlParser: true});
db = await connection.db(global.__MONGO_DB_NAME__);
});

afterAll(async () => {
await connection.close();
await db.close();
});
});
```

Expand Down

0 comments on commit 4efd29f

Please sign in to comment.