donal
2018-04-12 de3be129a09b9f4c230605bfb7347e1480941045
SOLUTION for exercise 3
2 files modified
1 files renamed
10 ■■■■ changed files
package.json 4 ●●●● patch | view | raw | blame | history
server/api/todo/todo.spec.js 6 ●●●● patch | view | raw | blame | history
server/config/environment/ci.js patch | view | raw | blame | history
package.json
@@ -70,8 +70,8 @@
    "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",
server/api/todo/todo.spec.js
@@ -193,10 +193,10 @@
  // 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) {
@@ -204,7 +204,7 @@
        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();
      });
  });
server/config/environment/ci.js