Skip to content

Commit 4fd5ada

Browse files
committed
Added basic tests
1 parent 38775fe commit 4fd5ada

4 files changed

Lines changed: 209 additions & 5 deletions

File tree

chapter1/index.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,11 @@
88
}
99
}
1010

11-
12-
let composedBlablaFunction = function(blaFunction){
11+
let composedBlablaFunction = function(blaFunction) {
1312
console.log('Get some air in your lungs!');
1413
blaFunction();
1514
console.log('Now you can rest!')
1615
}
1716

1817
composedBlablaFunction(blablaFunction('Hello world'))
19-
20-
2118
}());

chapter1/package-lock.json

Lines changed: 196 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

chapter1/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,8 @@
77
"test": "mocha here"
88
},
99
"author": "",
10-
"license": "MIT"
10+
"license": "MIT",
11+
"devDependencies": {
12+
"mocha": "^5.2.0"
13+
}
1114
}

chapter1/test/index.test.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
var assert = require('assert');
2+
describe('Array', function() {
3+
describe('#indexOf()', function() {
4+
it('should return -1 when the value is not present', function() {
5+
assert.equal([1,2,3].indexOf(4), -1);
6+
});
7+
});
8+
});

0 commit comments

Comments
 (0)