Skip to content

Commit

Permalink
chore: jest v28 support
Browse files Browse the repository at this point in the history
  • Loading branch information
vladholubiev committed May 30, 2022
1 parent 6093ff3 commit 15a66c7
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
9 changes: 6 additions & 3 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
{
"root": true,
"extends": ["@shelf/eslint-config/backend"],
"extends": [
"@shelf/eslint-config/typescript"
],
"rules": {
"no-console": 0,
"import/order": 0
"@typescript-eslint/no-var-requires": "off",
"no-console": "off",
"import/order": "off"
}
}
4 changes: 1 addition & 3 deletions environment.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const NodeEnvironment = require('jest-environment-node');
const {TestEnvironment} = require('jest-environment-node');
const path = require('path');
const fs = require('fs');
const uuid = require('uuid');
Expand All @@ -13,8 +13,6 @@ const globalConfigPath = path.join(cwd, 'globalConfig.json');
const options = getMongodbMemoryOptions();
const isReplSet = Boolean(options.replSet);

const TestEnvironment = NodeEnvironment.default ? NodeEnvironment.default : NodeEnvironment;

debug(`isReplSet`, isReplSet);

let mongo = isReplSet ? new MongoMemoryReplSet(options) : new MongoMemoryServer(options);
Expand Down
1 change: 0 additions & 1 deletion mongo-aggregate.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ describe('insert', () => {
let connection;
let db;


beforeAll(async () => {
connection = await MongoClient.connect(uri, {
useNewUrlParser: true,
Expand Down
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,15 @@
"uuid": "8.3.2"
},
"devDependencies": {
"@shelf/eslint-config": "1.5.0",
"@shelf/eslint-config": "2.18.0",
"@shelf/prettier-config": "1.0.0",
"eslint": "7.32.0",
"husky": "7.0.4",
"jest": "27.5.1",
"eslint": "8.16.0",
"husky": "8.0.1",
"jest": "28.1.0",
"lint-staged": "12.4.3",
"mongodb": "4.2.2",
"prettier": "2.6.2"
"mongodb": "4.6.0",
"prettier": "2.6.2",
"typescript": "4.7.2"
},
"peerDependencies": {
"jest-environment-node": "27.x.x",
Expand Down
1 change: 1 addition & 0 deletions setup.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable multiline-ternary */
const fs = require('fs');
const {join} = require('path');
const {MongoMemoryServer, MongoMemoryReplSet} = require('mongodb-memory-server');
Expand Down

0 comments on commit 15a66c7

Please sign in to comment.