From 61244cef3978e89b6ef5b197ded94c117557311a Mon Sep 17 00:00:00 2001 From: Vlad Holubiev Date: Thu, 17 Oct 2019 12:23:17 +0300 Subject: [PATCH] style: apply eslint fixes --- .eslintignore | 4 ++- mongo-insert.test.js | 2 ++ package.json | 63 ++++++++++++++++++++++---------------------- 3 files changed, 37 insertions(+), 32 deletions(-) diff --git a/.eslintignore b/.eslintignore index ec6d3cdd..1bd94dd2 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1 +1,3 @@ -package.json +coverage/ +lib/ +renovate.json diff --git a/mongo-insert.test.js b/mongo-insert.test.js index 82fcb4f5..2858d8b1 100644 --- a/mongo-insert.test.js +++ b/mongo-insert.test.js @@ -20,6 +20,7 @@ describe('insert', () => { await users.insertOne(mockUser); const insertedUser = await users.findOne({_id: 'some-user-id'}); + expect(insertedUser).toEqual(mockUser); }); @@ -30,6 +31,7 @@ describe('insert', () => { await users.insertMany(mockUsers); const insertedUsers = await users.find().toArray(); + expect(insertedUsers).toEqual([ expect.objectContaining({name: 'John'}), expect.objectContaining({name: 'Alice'}), diff --git a/package.json b/package.json index b342cf5f..38066fee 100644 --- a/package.json +++ b/package.json @@ -2,35 +2,48 @@ "name": "@shelf/jest-mongodb", "version": "1.1.1", "description": "Run your tests using Jest & MongoDB in Memory server", - "license": "MIT", + "keywords": [ + "jest", + "jest environment", + "jest preset", + "mongodb", + "mongodb local" + ], "repository": "shelfio/jest-mongodb", + "license": "MIT", "author": { "name": "Vlad Holubiev", "email": "vlad@shelf.io", "url": "shelf.io" }, - "engines": { - "node": ">=8" - }, "scripts": { - "lint": "eslint . --fix", + "lint": "eslint . --fix --ext .js,.json,.ts --quiet", "test": "jest" }, - "keywords": [ - "jest", - "mongodb", - "mongodb local", - "jest preset", - "jest environment" - ], + "husky": { + "hooks": { + "pre-commit": "lint-staged", + "post-commit": "git update-index --again" + } + }, + "lint-staged": { + "*.js": [ + "eslint --fix", + "git add" + ], + "*.{html,json,md,yml}": [ + "prettier --write", + "git add" + ] + }, + "jest": { + "preset": "./jest-preset.js" + }, "dependencies": { "cwd": "0.10.0", "debug": "4.1.1", "mongodb-memory-server": "5.2.8" }, - "peerDependencies": { - "mongodb": "3.x.x" - }, "devDependencies": { "@shelf/eslint-config": "0.8.2", "eslint": "6.5.1", @@ -40,23 +53,11 @@ "mongodb": "3.3.2", "prettier": "1.18.2" }, - "jest": { - "preset": "./jest-preset.js" - }, - "husky": { - "hooks": { - "pre-commit": "lint-staged" - } + "peerDependencies": { + "mongodb": "3.x.x" }, - "lint-staged": { - "*.js": [ - "eslint --fix", - "git add" - ], - "*.{html,json,md,yml}": [ - "prettier --write", - "git add" - ] + "engines": { + "node": ">=8" }, "publishConfig": { "access": "public"