nodeclub
nodeclub copied to clipboard
按教程可以跑起来,但make test报了4个错误。没改任何代码。
1) test/api/v1/reply.test.js create ups should down:
Uncaught AssertionError: expected 'up' to be 'down'
+ expected - actual
-up
+down
at Assertion.fail (node_modules/should/lib/assertion.js:92:17)
at Assertion.value (node_modules/should/lib/assertion.js:164:19)
at Test.<anonymous> (test/api/v1/reply.test.js:157:34)
at Test.assert (node_modules/supertest/lib/test.js:156:6)
at Server.assert (node_modules/supertest/lib/test.js:127:12)
at emitCloseNT (net.js:1656:8)
at process._tickCallback (internal/process/next_tick.js:178:19)
2) test/api/v1/topic.test.js get /api/v1/topic/:topicid should is_uped to be true with right accesstoken:
Uncaught AssertionError: expected false to be true
at Assertion.fail (node_modules/should/lib/assertion.js:92:17)
at Assertion.value (node_modules/should/lib/assertion.js:164:19)
at Test.<anonymous> (test/api/v1/topic.test.js:119:55)
at Test.assert (node_modules/supertest/lib/test.js:156:6)
at Server.assert (node_modules/supertest/lib/test.js:127:12)
at emitCloseNT (net.js:1656:8)
at process._tickCallback (internal/process/next_tick.js:178:19)
3) test/controllers/reply.test.js upvote reply should decrease:
Uncaught AssertionError: expected Object { action: 'up', success: true } to equal Object { action: 'down', success: true } (at action, A has 'up' and B has 'down')
+ expected - actual
{
- "action": "up"
+ "action": "down"
"success": true
}
at Assertion.fail (node_modules/should/lib/assertion.js:92:17)
at Assertion.value (node_modules/should/lib/assertion.js:164:19)
at Test.<anonymous> (test/controllers/reply.test.js:116:25)
at Test.assert (node_modules/supertest/lib/test.js:156:6)
at Server.assert (node_modules/supertest/lib/test.js:127:12)
at emitCloseNT (net.js:1656:8)
at process._tickCallback (internal/process/next_tick.js:178:19)
4) test/controllers/user.test.js #delete_all should delele all ups:
Uncaught TypeError: Cannot read property 'ups' of undefined
at test/controllers/user.test.js:273:19
at node_modules/mongoose/lib/document.js:1819:19
at handleError (node_modules/hooks-fixed/hooks.js:40:22)
at next_ (node_modules/hooks-fixed/hooks.js:75:26)
at fnWrapper (node_modules/hooks-fixed/hooks.js:186:18)
at node_modules/mongoose/lib/model.js:287:15
at node_modules/mongoose/lib/model.js:188:14
at node_modules/mongoose/lib/model.js:164:11
at handleCallback (node_modules/mongodb/lib/utils.js:96:12)
at node_modules/mongodb/lib/collection.js:1008:42
at commandCallback (node_modules/mongodb-core/lib/topologies/server.js:1142:9)
at Callbacks.emit (node_modules/mongodb-core/lib/topologies/server.js:116:3)
at Connection.messageHandler (node_modules/mongodb-core/lib/topologies/server.js:291:23)
at Socket.<anonymous> (node_modules/mongodb-core/lib/connection/connection.js:285:22)
at addChunk (_stream_readable.js:274:12)
at readableAddChunk (_stream_readable.js:261:11)
at Socket.Readable.push (_stream_readable.js:218:10)
at TCP.onread (net.js:581:20)
解决了吗 我也是遇到了这几个错误
请问你的教程在哪里看的
如果修改了config.js中的内容,make test就会报错