Skip to content
This repository has been archived by the owner on Aug 7, 2018. It is now read-only.

Commit

Permalink
fix for babel integration (also fixes #9)
Browse files Browse the repository at this point in the history
  • Loading branch information
make-github-pseudonymous-again committed Apr 8, 2015
1 parent c12a7dd commit 0b422f4
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 20 deletions.
4 changes: 1 addition & 3 deletions js/bin/aureooms-node-package-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,4 @@ var config = pkg.config;
var data = fs.readFileSync(config, 'utf8');
var opt = JSON.parse(data);

if ( opt.babel ) require( "babel-core/polyfill" ) ;

pkg.test(opt.name, opt.code.main, opt.code.test);
pkg.test( opt ) ;
13 changes: 9 additions & 4 deletions js/dist/pkg.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,12 @@
exports.list = list;
/* js/src/test.js */

var test = function test(name, codepath, testpath) {
var test = function test(opt) {

var path = require('path');
var argv = require('optimist').argv;
var testrunner = require('qunit');
var extend = require('node.extend');

testrunner.options.maxBlockDuration = 20000;
testrunner.options.coverage = true;
Expand All @@ -142,6 +143,10 @@
testrunner.options.log.assertions = false;
testrunner.options.log.summary = false;

if (opt.babel) testrunner.options.deps = 'node_modules/babel-core/polyfill';

extend(true, testrunner.options, opt.test);

var n = argv._.length || 1;
var failed = 0;
var done = 0;
Expand All @@ -160,10 +165,10 @@
var run = function run(item) {
testrunner.run({
code: {
path: path.normalize(codepath.join('/')),
namespace: name.replace('-', '')
path: path.normalize(opt.code.main.join('/')),
namespace: opt.name.replace('-', '')
},
tests: testpath.concat(item).join('/')
tests: opt.code.test.concat(item).join('/')
}, cb);
};

Expand Down
2 changes: 1 addition & 1 deletion js/dist/pkg.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/dist/pkg.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 15 additions & 10 deletions js/src/test.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@


var test = function(name, codepath, testpath){
var test = function ( opt ) {

var path = require('path');
var argv = require('optimist').argv;
var testrunner = require('qunit');
var extend = require('node.extend');

testrunner.options.maxBlockDuration = 20000;
testrunner.options.coverage = true;
testrunner.options.log.tests = false;
testrunner.options.log.testing = false;
testrunner.options.log.assertions = false;
testrunner.options.log.summary = false;
testrunner.options.maxBlockDuration = 20000 ;
testrunner.options.coverage = true ;
testrunner.options.log.tests = false ;
testrunner.options.log.testing = false ;
testrunner.options.log.assertions = false ;
testrunner.options.log.summary = false ;

if ( opt.babel ) testrunner.options.deps = "node_modules/babel-core/polyfill" ;

extend( true , testrunner.options , opt.test ) ;

var n = argv._.length || 1;
var failed = 0;
Expand All @@ -32,10 +37,10 @@ var test = function(name, codepath, testpath){
testrunner.run(
{
code : {
path : path.normalize(codepath.join('/')),
namespace : name.replace( '-' , '' )
path : path.normalize(opt.code.main.join('/')),
namespace : opt.name.replace( '-' , '' )
},
tests : testpath.concat(item).join('/')
tests : opt.code.test.concat(item).join('/')
}, cb
);
};
Expand Down
2 changes: 1 addition & 1 deletion test/js/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ var config = pkg.config;
var data = fs.readFileSync(config, 'utf8');
var opt = JSON.parse(data);

pkg.test(opt.name, opt.code.main, opt.code.test);
pkg.test( opt ) ;

0 comments on commit 0b422f4

Please sign in to comment.