Replace mocha with jest

To have a consisten test runner in both repos (Nitro-Web and
Nitro-Backend)
This commit is contained in:
Robert Schäfer 2018-12-20 17:55:03 +01:00
parent f47b136232
commit eaef67fad3
3 changed files with 1478 additions and 120 deletions

View File

@ -11,9 +11,9 @@
"start": "node dist/",
"dev": "nodemon --exec babel-node src/index.js",
"dev:debug": "nodemon --exec babel-node --inspect=0.0.0.0:9229 src/index.js",
"mocha": "mocha --require @babel/register src/**/*.test.js",
"jest": "jest",
"lint": "eslint src --config .eslintrc.js",
"test": "nyc --reporter=text-lcov mocha --require @babel/register src/**/*.test.js",
"test": "nyc --reporter=text-lcov jest",
"test:coverage": "nyc report --reporter=text-lcov > coverage.lcov",
"db:script:seed": "wait-on tcp:4001 && babel-node src/seed/seed-db.js",
"db:script:reset": "wait-on tcp:4001 && babel-node src/seed/reset-db.js",
@ -32,6 +32,7 @@
"cross-env": "~5.2.0",
"date-fns": "^2.0.0-alpha.26",
"dotenv": "~6.2.0",
"faker": "~4.1.0",
"graphql": "~0.13.0",
"graphql-custom-directives": "~0.2.14",
"graphql-iso-date": "~3.6.1",
@ -46,23 +47,24 @@
"neo4j-driver": "~1.7.2",
"neo4j-graphql-js": "~2.0.1",
"node-fetch": "~2.3.0",
"npm-run-all": "~4.1.5",
"passport": "~0.4.0",
"passport-jwt": "~4.0.0",
"sanitize-html": "~1.20.0",
"faker": "~4.1.0",
"slug": "~0.9.3",
"trunc-html": "~1.1.2",
"npm-run-all": "~4.1.5",
"wait-on": "~3.2.0"
},
"devDependencies": {
"@babel/cli": "~7.2.0",
"@babel/core": "~7.2.0",
"@babel/core": "^7.2.2",
"@babel/node": "~7.2.0",
"@babel/preset-env": "~7.2.0",
"@babel/register": "~7.0.0",
"apollo-server-testing": "~2.2.6",
"babel-core": "^7.0.0-0",
"babel-eslint": "~10.0.1",
"babel-jest": "^23.6.0",
"chai": "~4.2.0",
"eslint": "~5.10.0",
"eslint-config-standard": "~12.0.0",
@ -70,7 +72,7 @@
"eslint-plugin-node": "~8.0.0",
"eslint-plugin-promise": "~4.0.1",
"eslint-plugin-standard": "~4.0.0",
"mocha": "~5.2.0",
"jest": "^23.6.0",
"nodemon": "~1.18.9",
"nyc": "^13.1.0"
}

View File

@ -1,16 +1,14 @@
import { describe, it } from 'mocha'
describe('query', () => {
describe('statistics', () => {
describe('authenticated user', () => {
describe('read', () => {
it('is forbidden')
xit('is forbidden', () => {})
})
})
describe('admin', () => {
describe('read', () => {
it('is permitted')
xit('is permitted', () => {})
})
})
})

1578
yarn.lock

File diff suppressed because it is too large Load Diff