Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save muhammadghazali/37512c32945e03b0c64f73bdbf4e7b16 to your computer and use it in GitHub Desktop.
Save muhammadghazali/37512c32945e03b0c64f73bdbf4e7b16 to your computer and use it in GitHub Desktop.
tape will complain if there is two exclusive test in the entire process
Error: there can only be one only test
at Function.test.only (/my-node-app/node_modules/tape/index.js:140:25)
at Function.module.exports.lazyLoad.only (/my-node-app/node_modules/tape/index.js:26:34)
at Object.<anonymous> (/my-node-app/test/api-endpoints/submit-registration-token.test.js:47:6)
at Module._compile (module.js:624:30)
at Object.Module._extensions..js (module.js:635:10)
at Module.load (module.js:545:32)
at tryModuleLoad (module.js:508:12)
at Function.Module._load (module.js:500:3)
at Module.require (module.js:568:17)
at require (internal/module.js:11:18)
at /my-node-app/node_modules/tape/bin/tape:38:9
at Array.forEach (<anonymous>)
at /my-node-app/node_modules/tape/bin/tape:37:11
at Array.forEach (<anonymous>)
at Object.<anonymous> (/my-node-app/node_modules/tape/bin/tape:28:8)
at Module._compile (module.js:624:30)
npm ERR! Test failed. See above for more details.
test.only('Register blah account with valid required inputs', t => {
return request(app)
.post('/api/whatever-tokens')
.set('Content-Type', 'application/json')
.send({
token: chance.hash({length: SOME_LENGTH}),
})
.expect(200)
.then(res => {
t.equal(
res.body.hasOwnProperty('createdAt'),
true,
'response body should contains createdAt'
);
t.end();
})
.catch(err => t.end(err));
});
test.only('Register blah account with valid required inputs', t => {
return request(app)
.post('/api/whatever-tokens')
.set('Content-Type', 'application/json')
.send({
token: chance.hash({length: SOME_LENGTH}),
})
.expect(200)
.then(res => {
t.equal(
res.body.hasOwnProperty('updatedAt'),
true,
'response body should contains updatedAt'
);
t.end();
})
.catch(err => t.end(err));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment