8000 Add testing environment · ooade/Advanced-JavaScript@6ae7ab4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6ae7ab4

Browse files
committed
Add testing environment
1 parent 21f9afb commit 6ae7ab4

File tree

5 files changed

+107
-0
lines changed

5 files changed

+107
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

helper.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
var chalk = require('chalk')
2+
3+
module.exports = {
4+
assert: function assert(t, msg) {
5+
// If assertion is truthy, PASS else FAIL
6+
var res = !!t ? chalk.green('PASS') : chalk.red('FAIL')
7+
8+
return console.log(res + ' ' + msg)
9+
},
10+
error: function error(msg) {
11+
return console.log(chalk.red('ERROR') + ' ' + msg)
12+
},
13+
log: function log() {
14+
return console.log(Array.prototype.slice.call(arguments).join(' '))
15+
}
16+
}

package-lock.json

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

package.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "advanced-javascript",
3+
"version": "1.0.0",
4+
"description": "Advanced Javascript Documentation",
5+
"main": "start.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"repository": {
10+
"type": "git",
11+
"url": "git+https://github.com/ooade/Advanced-JavaScript.git"
12+
},
13+
"license": "ISC",
14+
"bugs": {
15+
"url": "https://github.com/ooade/Advanced-JavaScript/issues"
16+
},
17+
"homepage": "https://github.com/ooade/Advanced-JavaScript#readme",
18+
"devDependencies": {
19+
"chalk": "^2.3.0"
20+
}
21+
}

start.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
var assert = require('./helper').assert
2+
var error = require('./helper').error
3+
var log = require('./helper').log
4+
5+
// Run your code below this line

0 commit comments

Comments
 (0)
0