Skip to content

Commit

Permalink
Relax path resolution for transformers and preprocessors
Browse files Browse the repository at this point in the history
  • Loading branch information
rwaldron committed Apr 29, 2019
1 parent 0ea0a39 commit 76e1ce9
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions bin/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,21 @@ if (hostType) {
}

let timeout = argv.timeout || DEFAULT_TEST_TIMEOUT;
let transform;
let transform, transformer;
let preprocessor;

if (argv.transformer || argv.transform) {
transform = require(path.join(process.cwd(), argv.transformer || argv.transform));
if (argv.transformer) {
const transformerPath = path.isAbsolute(argv.transformer) ?
argv.transformer : path.join(process.cwd(), argv.transformer)

transform = transformer = require(transformerPath);
}

if (argv.preprocessor) {
preprocessor = require(path.join(process.cwd(), argv.preprocessor));
const preprocessorPath = path.isAbsolute(argv.preprocessor) ?
argv.preprocessor : path.join(process.cwd(), argv.preprocessor)

preprocessor = require(preprocessorPath);
}

if (argv.features) {
Expand Down

0 comments on commit 76e1ce9

Please sign in to comment.