Was looking at a tape + tap video and tried to get it to work.
OS: Windows 7
Git Bash Shell
node main.js | ./node_modules/.bin/tap-spec
stdout is not a tty.
main.js:
var test = require('tape');
var add = require('./add');
test('add: two numbers…
I am attempting to test this module (receiver.js) for an error thrown:
var request = require('request')
module.exports = function(url){
request({
url: url,
method: 'POST'
}, function(error) {
if(error){
…
What I'm doing
Edit: I created a repo with a simplified version of my problem reproducing the issue.
I'm trying to set up automated frontend testings with browserstack, selenium-webdriver and tape.
More about tape
The idea is to define multiple…
So I am trying to test out a function, it is a client-side function(un-finish) which is why it is embedded in the test itself(until I can figure out a better solution).
The problem I am having is when I test to see if the function is throwing a…
I'm working on a project which uses node and we're trying to achieve 100% coverage of our functions. This is the only function we haven't tested, and it's within another function.
var userInput = "";
req.on("data", function(data){
…
I've got an rxjs observer (really a Subject) that tails a file forever, just like tail -f. It's awesome for monitoring logfiles, for example.
This "forever" behavior is great for my application, but terrible for testing. Currently my application…
substack's tape testing module allows you to specify the number of assertions ahead of time with the plan method, and then it will automatically call end for you. Why not just put end at the end of a test? What is the difference between using…
If I have a function that throws an error and I want to test for that error, I'd write something like this:
test('throws at something that is not a string', t => {
t.plan(1)
t.err(loadString(9))
})
But this always results in an actual error…
I am using tape for testing in JavaScript, but in some cases I want to set some configuration variables that are available in all the tests within a file. Something like the setUp and tearDown methods available in PhpUnit. Those methods will be…
I'm trying to integrate Gulp with Tape (https://github.com/substack/tape), the NodeJs test harness.
How can I do this? There doesn't seem to be an existing gulp plugin.
I've see this, but it looks really inelegant:
var shell =…
I am debugging third party library unit test. Test case is running using tape and tape-run. It is using below command to run test cases.
"test": "browserify -x react-native -x react/addons -x react/lib/ReactContext -x react/lib/ExecutionEnvironment…
This is an interesting situation.
The puzzle is this:
The component's name is TODO
Controller.js
import Component from 'component';
import View from 'app-folder/components/todo/view';
export default Component.extend({
viewClass:…
I'm trying to test an async function that calls an API using Tape but I don't seem to be having much luck. I've used Mocha/Chai and Jasmine before but I'm not sure how to do what I want here.
This is the function I want to test
const…
I have the following implementation.
import _ from 'lodash';
import test from 'tape';
import 'jsdom-global/register';
let jQuery = require('jquery')(window);
let $ = global.jQuery = jQuery;
test('check if Deferred work?', (t) => {
let dfd =…