mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Setup unit/integration testing with mocha
This commit is contained in:
parent
0eab41b5ef
commit
0df58f00a1
@ -4,7 +4,7 @@
|
||||
"description": "GraphQL Backend for Human Connection",
|
||||
"main": "src/index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"test": "mocha --require @babel/register src/**/*.test.js",
|
||||
"start": "./node_modules/.bin/nodemon --exec babel-node src/index.js",
|
||||
"start:debug": "./node_modules/.bin/nodemon --exec babel-node --inspect=0.0.0.0:9229 src/index.js",
|
||||
"seedDb": "./node_modules/.bin/babel-node src/seed/seed-db.js"
|
||||
@ -46,7 +46,9 @@
|
||||
"trunc-html": "^1.1.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"chai": "^4.2.0",
|
||||
"faker": "^4.1.0",
|
||||
"mocha": "^5.2.0",
|
||||
"nodemon": "^1.18.4"
|
||||
}
|
||||
}
|
||||
|
||||
21
src/middleware/permissionsMiddleware.test.js
Normal file
21
src/middleware/permissionsMiddleware.test.js
Normal file
@ -0,0 +1,21 @@
|
||||
import { describe, it } from 'mocha'
|
||||
import { expect } from 'chai'
|
||||
|
||||
|
||||
describe('query', () => {
|
||||
describe('statistics', () => {
|
||||
describe('authenticated user', () => {
|
||||
describe('read', () => {
|
||||
it('is forbidden', () => {
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
context('admin', () => {
|
||||
describe('read', () => {
|
||||
it('is permitted', () => {
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
Loading…
x
Reference in New Issue
Block a user