Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble using --path option via the CLI w/ --transform option #150

Open
sankho opened this issue Apr 12, 2017 · 1 comment
Open

Trouble using --path option via the CLI w/ --transform option #150

sankho opened this issue Apr 12, 2017 · 1 comment

Comments

@sankho
Copy link

sankho commented Apr 12, 2017

As per #132 I'm trying to use the --paths option in browserify w/ mochify to avoid writing relative paths everywhere.

> mochify --path ./app --transform babelify --transform envify test/**/*.js

/.../node_modules/mochify/node_modules/browserify/index.js:332
            paths: (self._options.paths || []).map(function (p) {
                                               ^

TypeError: (self._options.paths || []).map is not a function

Attempting to use just one of the transforms didn't change things.

However, if I take away the transforms, things work, but obviously my tests error out since they needed babelify.

I got something slightly different when trying to format the argument as an array:

> mochify --path [./app] --transform babelify test/**/*.js

/.../node_modules/mochify/node_modules/module-deps/index.js:52
        .filter(Boolean)
         ^

TypeError: this.paths.filter is not a function

Any help would be appreciated!

@mantoni
Copy link
Owner

mantoni commented Jun 2, 2017

@sankho Sorry for the late reply. The issue seems to be that --path returns a string while the internal paths option must be an array. PR #132 was implemented mainly for API use and the test case verifies it works when passing in an array. I think the solution here would be to check if opts.path is an array, and if not wrap it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants