| | |
| | | steps { |
| | | echo '### Running unit tests ###' |
| | | sh 'cd books; npm test' |
| | | junit 'books/reports/server/mocha/test-results.xml' |
| | | } |
| | | } |
| | | |
| | |
| | | "private": true, |
| | | "scripts": { |
| | | "start": "node ./exec/www", |
| | | "test": "export MOCHA_FILE='reports/server/mocha/test-results.xml' && IP=0.0.0.0 PORT=3030 node_modules/.bin/nyc --reporter=text node_modules/.bin/mocha tests/*_test.js -R mocha-junit-reporter", |
| | | "test": "IP=0.0.0.0 PORT=3030 node_modules/.bin/mocha tests/*_test.js", |
| | | "lint": "node_modules/.bin/eslint . --ext .js" |
| | | }, |
| | | "dependencies": { |
| | |
| | | |
| | | const authors = require('../data/authors'); |
| | | |
| | | var user; |
| | | |
| | | /* GET users listing. */ |
| | | router.get('/', (req, res) => { |
| | |
| | | .get('/authors') |
| | | .end((err, res) => { |
| | | expect(res).to.have.status(200); |
| | | expect(res.text).to.include('James Joyce'); |
| | | expect(res.text).to.include('James_Joyce'); |
| | | done(); |
| | | }); |
| | | }); |