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

support for strict mode #1999

Merged
merged 1 commit into from
Dec 25, 2015
Merged

support for strict mode #1999

merged 1 commit into from
Dec 25, 2015

Conversation

tmont
Copy link
Contributor

@tmont tmont commented Dec 9, 2015

Support for passing along the --use_strict flag from mocha to _mocha. Also fixes a strict code incompatibility with the undeclared variable Reporter in _mocha, as outlined in #1879.

Tests all pass and the lib works on node v4.2.3 and v5.1.1.

Review on Reviewable

@danielstjules
Copy link
Contributor

Could you add it to https://github.com/mochajs/mocha/blob/master/bin/_mocha#L58 Without that, it's not usable via mocha.opts

@tmont
Copy link
Contributor Author

tmont commented Dec 9, 2015

done, and i rebased as well.

@boneskull
Copy link
Contributor

this needs a minor or major release. I realize now my chalk-related changes need a major. I can back them out and put them in v3 branch so we can stick this in v2.4.0

@danielstjules
Copy link
Contributor

Minor makes sense, but this change wouldn't force a major, right?

@boneskull
Copy link
Contributor

Nope just an pption

danielstjules added a commit that referenced this pull request Dec 25, 2015
@danielstjules danielstjules merged commit 50920fc into mochajs:master Dec 25, 2015
@danielstjules
Copy link
Contributor

Thanks again!

@h2jorm
Copy link

h2jorm commented Jan 1, 2016

Some code in mkdirp module can not be executed in strict mode. So '--use_strict' flag is still not accessable.

leeching:s-cms leeching$ npm tst

> s-cms@0.0.1 test /Users/leeching/coding.net/s-cms
> mocha --harmony --harmony-destructuring --use_strict test

/Users/leeching/coding.net/s-cms/node_modules/mkdirp/index.js:19
        mode = 0777 & (~process.umask());
               ^^^^

SyntaxError: Octal literals are not allowed in strict mode.
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:374:25)
    at Object.Module._extensions..js (module.js:405:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/Users/leeching/coding.net/s-cms/node_modules/mocha/lib/reporters/xunit.js:10:14)
    at Module._compile (module.js:398:26)
    at Object.Module._extensions..js (module.js:405:10)
npm ERR! Test failed.  See above for more details.

@danielstjules
Copy link
Contributor

Ah, I should have tested it again after the rebase. The issue is a result of merging #1995

Edit: Looks like mkdirp 0.5.1 fixes this :)

@danielstjules
Copy link
Contributor

Fixed in master. Thanks!

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

Successfully merging this pull request may close these issues.

4 participants