Skip to content

Commit

Permalink
add ava modules to test module paths
Browse files Browse the repository at this point in the history
Closes avajs#144
  • Loading branch information
floatdrop committed Nov 7, 2015
1 parent 08854a9 commit 46e33ed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions lib/babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
var resolveFrom = require('resolve-from');
var createEspowerPlugin = require('babel-plugin-espower/create');
var requireFromString = require('require-from-string');
var path = require('path');
var hasGenerators = parseInt(process.version.slice(1), 10) > 0;
var path = process.argv[2];

var testPath = process.argv[2];
var babel;

try {
Expand All @@ -24,5 +25,7 @@ var options = {
]
};

var transpiled = babel.transformFileSync(path, options);
requireFromString(transpiled.code, path);
var transpiled = babel.transformFileSync(testPath, options);
requireFromString(transpiled.code, testPath, {
appendPaths: module.paths
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"power-assert-formatter": "^1.3.0",
"power-assert-renderers": "^0.1.0",
"pretty-ms": "^2.0.0",
"require-from-string": "^1.0.0",
"require-from-string": "^1.1.0",
"resolve-from": "^1.0.0",
"serialize-error": "^1.0.0",
"set-immediate-shim": "^1.0.1",
Expand Down

0 comments on commit 46e33ed

Please sign in to comment.