Skip to content

Commit

Permalink
use browserify programmatically
Browse files Browse the repository at this point in the history
  • Loading branch information
lawnsea committed Aug 11, 2014
1 parent 0fabff0 commit 85aeefc
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions test/browser-runner.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require('colors');
var childProcess = require('child_process');
var browserify = require('browserify');
var EventEmitter = require('events').EventEmitter;
var fs = require('fs');
var httpServer = require('http-server');
var nodeunit = require('nodeunit');
var optimist = require('./runner-options');
Expand Down Expand Up @@ -128,17 +129,10 @@ function run() {
}

// browserify and run the tests
childProcess.exec(
'node_modules/browserify/bin/cmd.js test/worker.js -o test/worker-bundle.js',
function (err, stdout, stderr) {
if (err) {
console.log(stdout.toString());
console.log('Failed to browserify test/worker');
console.log(err);
process.exit(1);
return;
}

browserify('./test/worker.js').
bundle().
pipe(fs.createWriteStream('./test/worker-bundle.js')).
on('finish', function () {
// start web server
var webServer = httpServer.createServer().listen(httpPort);

Expand Down

0 comments on commit 85aeefc

Please sign in to comment.