Skip to content

Commit

Permalink
Add basic test to check tape working
Browse files Browse the repository at this point in the history
  • Loading branch information
jc2820 committed Nov 20, 2019
1 parent 877063b commit 9313294
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"test": "test"
},
"scripts": {
"test": "nodemon test/tests.js | tap-spec",
"cover": "nyc tape test/tests.js | tap-spec"
"test": "tape test/test.js | tap-spec",
"cover": "nyc tape test/test.js | tap-spec"
},
"repository": {
"type": "git",
Expand Down
13 changes: 13 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const test = require('tape');

// Test that tape is working OK
const sum = (a, b) => {
return a + b;
}

test('sum should return the addition of two numbers', function (t) {
let actual = sum(1, 2);
let expected = 3;
t.equal(actual, expected);
t.end();
});

0 comments on commit 9313294

Please sign in to comment.