Skip to content

Commit

Permalink
test: fix test case in node6
Browse files Browse the repository at this point in the history
  • Loading branch information
dead-horse committed Dec 1, 2016
1 parent 6e2762e commit 3cd0712
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 13 deletions.
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ install:

test:
@NODE_ENV=test ./node_modules/mocha/bin/mocha \
--harmony\
--reporter $(REPORTER) \
--timeout $(TIMEOUT) \
--require should \
Expand All @@ -17,7 +16,7 @@ test:


test-cov:
@NODE_ENV=test node --harmony \
@NODE_ENV=test node \
node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha \
-- -u exports \
--reporter $(REPORTER) \
Expand All @@ -27,7 +26,7 @@ test-cov:
$(TESTS)

test-travis:
@NODE_ENV=test node --harmony \
@NODE_ENV=test node \
node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha \
--report lcovonly \
-- -u exports \
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
"blanket": "*",
"contributors": "*",
"istanbul-harmony": "*",
"koa": "~1.2.0",
"koa": "^1.2.4",
"koa-redis": "~2.1.1",
"mm": "~1.5.0",
"mocha": "2",
"pedding": "^1.0.0",
"should": "~10.0.0",
"supertest": "~0.13.0"
"supertest": "~2.0.1"
},
"engines": {
"node": ">= 0.11.9"
Expand Down
4 changes: 2 additions & 2 deletions test/support/defer.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,15 @@ function nosession(ctx) {
}

function *nothing(ctx) {
ctx.body = (yield ctx.session).count;
ctx.body = String((yield ctx.session).count);
}

function *get(ctx) {
var session = yield ctx.session;
session = yield ctx.session;
session.count = session.count || 0;
session.count++;
ctx.body = session.count;
ctx.body = String(session.count);
}

function *remove(ctx) {
Expand Down
8 changes: 4 additions & 4 deletions test/support/override.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ app.use(function *controllers() {
this.sessionSave = false;
remove(this);
break;

case '/session/remove/force':
this.sessionSave = true;
remove(this);
Expand All @@ -68,18 +68,18 @@ app.use(function *controllers() {

function read(ctx) {
ctx.session.count = ctx.session.count || 0;
ctx.body = ctx.session.count;
ctx.body = String(ctx.session.count);
}

function update(ctx) {
ctx.session.count = ctx.session.count || 0;
ctx.session.count++;
ctx.body = ctx.session.count;
ctx.body = String(ctx.session.count);
}

function remove(ctx) {
ctx.session = null;
ctx.body = 0;
ctx.body = '0';
}

var app = module.exports = http.createServer(app.callback());
4 changes: 2 additions & 2 deletions test/support/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ function nothing(ctx) {
function get(ctx) {
ctx.session.count = ctx.session.count || 0;
ctx.session.count++;
ctx.body = ctx.session.count;
ctx.body = String(ctx.session.count);
}

function getError(ctx) {
Expand All @@ -140,7 +140,7 @@ function getError(ctx) {

function remove(ctx) {
ctx.session = null;
ctx.body = 0;
ctx.body = '0';
}

function switchHttpOnly(ctx) {
Expand Down

0 comments on commit 3cd0712

Please sign in to comment.