-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
chore(build): use new config format for mocha v6.x #2309
Conversation
2109e07
to
3f57b1f
Compare
Need to investigate why |
IIRC, AppVeyor is running an old version of Node.js 8.x. HTTP2 API was marked as stable at the time when 8.x was already in LTS state. We are also not able to upgrade to the latest version of Node.js 10.x because the tests are freezing - see #1431 |
packages/build/package.json
Outdated
@@ -20,7 +20,7 @@ | |||
"debug": "^4.0.1", | |||
"fs-extra": "^7.0.0", | |||
"glob": "^7.1.2", | |||
"mocha": "^5.1.1", | |||
"mocha": "^6.0.0-1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As commented in the original PR, I am reluctant to use pre-release versions. Can we wait until 6.0.0
is released please, and then use that version instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. The PR was created to test out 6.x.
@@ -31,8 +31,8 @@ function run(argv, options) { | |||
if (typeof options === 'boolean') options = {dryRun: options}; | |||
options = options || {}; | |||
if (setMochaOpts) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setMochaOpts is checking for presence of --opts
. So IIUC the current implementation, if --opts
is not provided, we add --config
. Which means that lb-mocha --config my.json
will add --config .mocharc.json
to the command line, ending up with two --config
flags. Is that desirable? I think it's not. Either way, please add a test to verify how lb-mocha
behaves in this scenario.
How about backwards compatibility? If we replace --opts
with --config
in our check and stop detecting --opts
, then I think this is a breaking change requiring a semver-major release. It may be more conventient for our users if we keep support for both --opts
and --config
options. Either way, please add a test to verify what happens when lb-mocha
is invoked with --opts
only: do we add --config
or not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it's better to bump @loopback/build
to the next major version. Using --opts
for mocha@6.x seems to be add confusion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am fine with publishing a new semver-major version of @loopback/build
. See https://github.com/strongloop/loopback-next/blob/master/docs/site/DEVELOPING.md#making-breaking-changes for a check-list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It turns out that mocha 6.x continues to support mocha.opts
. I have improved the PR to respect --opts
and mocha.opts
in addition to .mocharc.*
formats. It should be now backward compatible.
3f57b1f
to
946993e
Compare
946993e
to
49febdd
Compare
FWIW, |
@raymondfeng what's the status of this pull request? How is it different from #2422 which you have already landed? |
I would like to land this PR, which converts to the new |
49febdd
to
ea68719
Compare
Sounds good to me. We need to follow the process for a new major version now. Quoting from https://github.com/strongloop/loopback-next/blob/master/docs/site/DEVELOPING.md#making-breaking-changes
Most importantly, the commit message introducing the breaking change must include We will need to update As for other breaking changes to include in the release, I am not really aware of any. |
Let's apply the same format we use in LB3 repositories, see e.g. |
fe4ab2d
to
71d7696
Compare
@bajtos I think I have made it backward compatible except breaking changes from |
packages/build/bin/utils.js
Outdated
'.mocharc.json', | ||
'.mocharc.yaml', | ||
'.mocharc.yml', | ||
'mocha.opts', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the default config file is test/mocha.opts
, not mocha.opts
. Has this changed in mocha@6
?
/cc @boneskull
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. I fixed it.
71d7696
to
097ab71
Compare
097ab71
to
4f8e2f8
Compare
Supersedes #2281.
Checklist
npm test
passes on your machinepackages/cli
were updatedexamples/*
were updated