2 files modified
1 files renamed
| | |
| | | "clean": "rm -rf reports package-contents*", |
| | | "build:ci": "mkdir -p package-contents && cp -vr server Dockerfile package.json package-contents", |
| | | "package": "zip -r package-contents.zip package-contents", |
| | | "test": "node_modules/.bin/nyc node_modules/.bin/mocha server/**/*.spec.js --exit", |
| | | "test:ci": "export MOCHA_FILE='reports/server/mocha/test-results.xml' && export NODE_ENV=ci && node_modules/.bin/nyc node_modules/.bin/mocha server/**/*.spec.js -R mocha-junit-reporter --exit", |
| | | "test": "node_modules/.bin/nyc node_modules/.bin/mocha './server/**/*.spec.js' --exit", |
| | | "test:ci": "export MOCHA_FILE='reports/server/mocha/test-results.xml' && export NODE_ENV=ci && node_modules/.bin/nyc node_modules/.bin/mocha './server/**/*.spec.js' -R mocha-junit-reporter --exit", |
| | | "mongo": "docker run -i -d --name mongo-local -p 27017:27017 mongo", |
| | | "mongo:drop": "npm run mongo:stop && docker rm mongo-local", |
| | | "mongo:stop": "docker stop mongo-local", |
| | |
| | | |
| | | |
| | | // Exercise 3 test case! |
| | | it("should ....", function(done) { |
| | | it("should mark todo as important and persist it", function(done) { |
| | | request(app) |
| | | .put("/api/todos/" + todoId) |
| | | .send({ title: "LOVE endpoint/server side testing!", completed: true }) |
| | | .send({ title: "LOVE endpoint/server side testing!", completed: true, important: true }) |
| | | .expect(200) |
| | | .expect("Content-Type", /json/) |
| | | .end(function(err, res) { |
| | |
| | | res.body.should.have.property("_id"); |
| | | res.body.title.should.equal("LOVE endpoint/server side testing!"); |
| | | // YOUR TEST GO HERE |
| | | |
| | | res.body.important.should.equal(true); |
| | | done(); |
| | | }); |
| | | }); |