Mercurial > hg > beaglert
comparison resources/osc/node_modules/osc-min/Cakefile @ 271:fb9c28a4676b prerelease
Added osc example project and node script for testing
author | Liam Donovan <l.b.donovan@qmul.ac.uk> |
---|---|
date | Tue, 17 May 2016 16:01:06 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
270:de37582ce6f3 | 271:fb9c28a4676b |
---|---|
1 fs = require 'fs' | |
2 child = require 'child_process' | |
3 | |
4 task 'test', 'run tests (requires development install)', (options) -> | |
5 process.env['NODE_PATH'] = './lib/:$NODE_PATH' | |
6 test = child.spawn 'mocha', ['--compilers', 'coffee:coffee-script/register', '-u', 'tdd', 'test'] | |
7 test.stdout.pipe process.stdout | |
8 test.stderr.pipe process.stderr | |
9 test.on 'exit', (num) -> | |
10 return process.exit num | |
11 | |
12 spawnMochaCov = (reporter) -> | |
13 return child.spawn 'mocha', ['--compilers', 'coffee:coffee-script/register', '-r', 'blanket', '-R', reporter, '-u', 'tdd', 'test'] | |
14 | |
15 task 'coverage', 'run tests with coverage check (requires development install)', (options) -> | |
16 process.env['NODE_PATH'] = './lib/:$NODE_PATH' | |
17 test = spawnMochaCov 'html-cov' | |
18 file = fs.createWriteStream 'coverage.html' | |
19 test.stdout.pipe file | |
20 test.stderr.pipe process.stderr | |
21 test.on 'exit', (num) -> | |
22 child.exec 'open ./coverage.html' | |
23 | |
24 task 'coveralls', 'report coveralls to travis', (options) -> | |
25 process.env['NODE_PATH'] = './lib/:$NODE_PATH' | |
26 test = spawnMochaCov 'mocha-lcov-reporter' | |
27 report = child.spawn './node_modules/coveralls/bin/coveralls.js' | |
28 test.stdout.pipe report.stdin | |
29 test.stderr.pipe process.stderr | |
30 | |
31 task 'doc', 'create md and html doc files', (options) -> | |
32 child.exec 'coffee -b -c examples/*', -> | |
33 child.exec 'docket lib/* examples/* -m', -> | |
34 child.exec 'docket lib/* examples/* -d doc_html' | |
35 | |
36 task 'browserify', 'build for a browser', (options)-> | |
37 fs.mkdir './build', -> | |
38 child.exec './node_modules/browserify/bin/cmd.js ./lib/index.js --standalone osc -o ./build/osc-min.js', -> | |
39 child.exec './node_modules/uglify-js/bin/uglifyjs -o ./build/osc-min.min.js ./build/osc-min.js' |