What's the best way to use testdouble.js with tape?
See original GitHub issueI saw https://github.com/testdouble/testdouble.js/issues/33 but it’s quite verbose to use testdouble with tape:
const test = require('tape');
const td = require('testdouble');
test('verify invoked', function(t) {
t.plan(1)
var stub = td.create()
stub('any arguments', 0, 1, 2)
t.doesNotThrow(function() {
td.verify(stub0())
}, 'called with more arguments when none are specified')
})
Anyway to not pass a callback to t.doesNotThrow?
Thanks!
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Getting Started | testdouble.js - GitHub Pages
This document provides a walk-through of one way to use testdouble.js, but some folks have indicated to us that it was not a...
Read more >testdouble.js vs TwistedTrial comparison of testing frameworks
What are the differences between testdouble.js and TwistedTrial? Alternatives for testing frameworks in JavaScript and Python.
Read more >Testing JavaScript Modules with Tape - Ponyfoo
Using tape, proxyquire, and sinon is the best possible combination of ... how to use them, what each of them is good for,...
Read more >What you need to know about ES modules in Node.js
Confused about ES module support in Node.js? ... post isn't going to cover much about what ECMAScript (ES) modules are or how to...
Read more >Nodejs HAPI Tape Pre Unit test - Stack Overflow
Using the Tape and Test Double Libraries for testing test('drayage/recommend-ramps route: should return 201 when successfully processed', ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

If you really want to use
t.plan(…)then I suggest you also uset.pass(…):TAP Output:
Because
td.verifythrows an error, one option might be to use tape-catch: https://github.com/michaelrhodes/tape-catch