Files: a302d2c9463a516a36050f68df0818c2a57deff3 / verify.js
610 bytesRaw
1 | var path = require('path') |
2 | var tests = [ |
3 | require('./helpers/sink'), |
4 | require('./helpers/source'), |
5 | require('./helpers/map'), |
6 | require('./helpers/pull'), |
7 | require('./helpers/take') |
8 | ] |
9 | |
10 | if(process.argv.length !== 4) { |
11 | console.error('usage: verify.js [1-5] script.js') |
12 | process.exit(1) |
13 | } |
14 | |
15 | var i = +process.argv[2] - 1 |
16 | |
17 | if(isNaN(i)) throw new Error('first argument must be integer, 1 - 5') |
18 | if(!tests[i]) |
19 | throw new Error('there are no tests for that exercise, expected') |
20 | |
21 | var test = tests[i] |
22 | console.log('', i, test) |
23 | console.log(path.resolve(process.argv[3])) |
24 | test(require(path.resolve(process.argv[3]))) |
25 |
Built with git-ssb-web