build(build): upgrade Mocha to v6 prerelease#2281
build(build): upgrade Mocha to v6 prerelease#2281boneskull wants to merge 1 commit intoloopbackio:masterfrom
Conversation
|
I think commitizen may be misconfigured; wasn't sure which type(scope) to use here as it disallowed anything I was trying for scope (e.g., |
|
cla bot seems kind of busted too; typing "I AGREE" then clicking the button didn't seem to do anything and I received no confirmation (but it did work) |
|
@boneskull Thank you for the PR to verify if our build works with mocha 6.x. The CI fails due to the following error: Is |
bajtos
left a comment
There was a problem hiding this comment.
This is great, thank you @boneskull for upgrading our project to the upcoming Mocha version!
Is there any ETA on when Mocha v6 will be released? I'd rather not depend on pre-release versions and wait with landing this pull request until mocha@6.0.0 is released.
| function cleanup() { | ||
| var run = require('../../bin/run-clean'); | ||
| run(['node', 'bin/run-clean', 'test/mocha.opts']); | ||
| run(['node', 'bin/run-clean', 'test/.mocharc.json']); |
There was a problem hiding this comment.
AFAICT, .mocharc.json is placed in project root, not in test directory.
| run(['node', 'bin/run-clean', 'test/.mocharc.json']); | |
| run(['node', 'bin/run-clean', '.mocharc.json']); |
| --require source-map-support/register | ||
| --recursive | ||
| --exit | ||
| --reporter dot |
There was a problem hiding this comment.
I believe we have two Mocha configurations:
- The config in
packages/buildthat's primarily used inside loopback-next monorepo. It's important to include--exitand--reporter dotoptions. - The template in
packages/cli/generators/project/templates/test/mocha.optsthat's used when scaffolding new LB4 project.
IIUC, your pull request is correctly reworking the template from mocha.opts to .mocharc.json, but completely removing the config used by loopback-next. Please preserve both sets of configuration. Maybe you just forgot to commit the file packages/build/config/.mocharc.json? I see you are referring to it in multiple places, but don't see that file in the pull request.
While we are discussing this part, can we remove the dot prefix from the filename please, to make the file easier to find? Dot files are considered as "hidden" on Unix-like systems. It makes a lot of sense to use a dot file in project root (.mocharc.json), but I find it counter-productive to use a dot file elsewhere in project directory tree.
I am proposing the following filename:
packages/build/config/mocharc.json
There was a problem hiding this comment.
I named it .mocharc.json because the other dotfiles in that directory begin with a dot (e.g., .nycrc, .prettierrc).
There was a problem hiding this comment.
I think I'd prefer to keep the name as it is for consistency and to avoid confusion between .mocharc.json and mocharc.json?
There was a problem hiding this comment.
I named it
.mocharc.jsonbecause the other dotfiles in that directory begin with a dot (e.g.,.nycrc,.prettierrc).
I think I'd prefer to keep the name as it is for consistency and to avoid confusion between.mocharc.jsonandmocharc.json?
Fair enough 👍
There was a problem hiding this comment.
I believe this part was not addressed yet:
IIUC, your pull request is correctly reworking the template from mocha.opts to .mocharc.json, but completely removing the config used by loopback-next. Please preserve both sets of configuration. Maybe you just forgot to commit the file packages/build/config/.mocharc.json? I see you are referring to it in multiple places, but don't see that file in the pull request.
|
There's no real ETA, but I think I'm going to try to get another prerelease out today. |
It's not required unless the path is explicitly given via |
also replaces legacy mocha.opts with new .mocharc.json
|
@boneskull Please port |
|
Enhanced as #2309 |
also replaces legacy mocha.opts with new .mocharc.json
Checklist
npm testpasses on your machinepackages/cliwere updatedexamples/*were updated