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

--harmony-proxies option not working #1980

Closed
JaKXz opened this issue Nov 26, 2015 · 12 comments
Closed

--harmony-proxies option not working #1980

JaKXz opened this issue Nov 26, 2015 · 12 comments

Comments

@JaKXz
Copy link

JaKXz commented Nov 26, 2015

This is my mocha.opts file in my test/ folder:

--compilers js:babel/register
--require mocha.conf.js
--harmony-proxies

I'm using mocha v2.3.4, and node v5.1.0 and I get the error:

  error: unknown option `--harmony-proxies'

EDIT: In fact, none of the --harmony options are working.

@danielstjules
Copy link
Contributor

Looks like a regression in 2.3.3. Works in 2.3.2.

@boneskull
Copy link
Member

@danielstjules I don't know about that, I can't reproduce it using his setup.

@danielstjules
Copy link
Contributor

@boneskull I think it's a regression :(

$ cat test/mocha.opts
--harmony-proxies
dstjules:~/Desktop
$ mocha --version
2.3.2
dstjules:~/Desktop
$ mocha


  0 passing (4ms)

dstjules:~/Desktop
$ npm install -g mocha@2.3.3
/usr/local/bin/mocha -> /usr/local/lib/node_modules/mocha/bin/mocha
/usr/local/bin/_mocha -> /usr/local/lib/node_modules/mocha/bin/_mocha
mocha@2.3.3 /usr/local/lib/node_modules/mocha
├── escape-string-regexp@1.0.2
├── supports-color@1.2.0
├── growl@1.8.1
├── commander@2.3.0
├── diff@1.4.0
├── debug@2.0.0 (ms@0.6.2)
├── jade@0.26.3 (commander@0.6.1, mkdirp@0.3.0)
├── glob@3.2.3 (inherits@2.0.1, graceful-fs@2.0.3, minimatch@0.2.14)
└── mkdirp@0.5.0 (minimist@0.0.8)
dstjules:~/Desktop
$ mocha --version
2.3.3
dstjules:~/Desktop
$ mocha

  error: unknown option `--harmony-proxies'

@danielstjules
Copy link
Contributor

Looks like it's my fault, sorry: c4647bf

@danielstjules
Copy link
Contributor

@JaKXz Note that this still works by passing options to the bin. So in the meantime, you can do:
mocha --harmony-proxies

I'll have a fix for this tomorrow.

@JaKXz
Copy link
Author

JaKXz commented Nov 26, 2015

@danielstjules thanks!

@danielstjules
Copy link
Contributor

Nevermind, this isn't a regression in that relase. Any node-specific flags (harmony, etc) need to be passed via CLI, and not placed in mocha.opts. When passed via CLI, bin/mocha will spawn an instance of bin/_mocha with the harmony flags.

@danielstjules
Copy link
Contributor

This was a result of #1910 But we can't remove getOptions from _mocha, due to #1645 I think an immediate solution would be to check whether or not the options have already been loaded

@danielstjules
Copy link
Contributor

Fixed in master. Thanks again! :)

@JaKXz
Copy link
Author

JaKXz commented Dec 26, 2015

Thank you, @danielstjules! and Merry Christmas/Happy Holidays/etc 🎄 🎅 ✨

@josmardias
Copy link

Harmony flags doesn't work for me while using bin/_mocha (required by istanbul)

  "devDependencies": {
    "chai": "^3.5.0",
    "istanbul": "^0.4.2",
    "mocha": "^2.4.5"
  },

I'm trying --harmony_default_parameters node flag
Reproduction here

Obs.: it does work for bin/mocha binary

@boneskull
Copy link
Member

@josmardias mocha exists so that _mocha can be run with node flags. You will need to execute istanbul with node flags.

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

No branches or pull requests

4 participants