Skip to content

Commit

Permalink
Merge pull request #151 from floatdrop/add-ava-modules-to-test-module…
Browse files Browse the repository at this point in the history
…-paths

Add ava modules to test module paths
  • Loading branch information
sindresorhus committed Nov 7, 2015
2 parents 08854a9 + de0955b commit 5ec1574
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions lib/babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
var resolveFrom = require('resolve-from');
var createEspowerPlugin = require('babel-plugin-espower/create');
var requireFromString = require('require-from-string');
var hasGenerators = parseInt(process.version.slice(1), 10) > 0;
var path = process.argv[2];

var hasGenerators = parseInt(process.version.slice(1), 10) > 0;
var testPath = process.argv[2];
var babel;

try {
Expand All @@ -24,5 +24,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 5ec1574

Please sign in to comment.