-
Notifications
You must be signed in to change notification settings - Fork 30k
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
test: use common.fixturesDir almost everywhere #6997
Conversation
@@ -13,7 +14,7 @@ assert.equal('bar', | |||
baseBar, // eslint-disable-line no-undef | |||
'global.x -> x in base level not working'); | |||
|
|||
var module = require('../fixtures/global/plain'); | |||
var module = require(path.join(common.fixturesDir, 'global/plain')); |
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.
Can you do this: path.join(common.fixturesDir, 'global', 'plain')
LGTM with @cjihrig's nits addressed. |
@cjihrig Ok, Also, CI: https://ci.nodejs.org/job/node-test-pull-request/2814/ |
CI doesn't seem happy. I see errors besides the regular address failures in there. Concept seems fine though. |
@@ -1,10 +1,10 @@ | |||
'use strict'; | |||
require('../common'); | |||
var common = require('../common'); |
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.
Nit: const
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's a nit so you can ignore it, of course, but if you do want to const-ify common
here, you can also do it in the other files too. (Looks like you used var
where the file was doing that for other modules and const
where it was already using that. Which is also just fine. Like I said: nit.)
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.
Right, I kept with whatever was being used in the file, for least-confusion/impact.
I think const
-ifying tests makes more sense in separate PR(s)/commit(s). SGTY?
At least some of the CI problems look like things that might be addressed by a9492f5 which isn't in this branch (and the CI wasn't run to rebase against master--aside: should we change that to be the default in node-test-pull-request?). In short, rebase against master might help with the CI results a bit. EDIT: Whoops, used the wrong commit hash, updated it. But if you clicked on it in your email and got a puzzling result, that's why. |
@@ -43,7 +44,7 @@ assert.strictEqual(internalUtil.getHiddenValue(obj, 'foo'), 'bar'); | |||
let arrowMessage; | |||
|
|||
try { | |||
require('../fixtures/syntax/bad_syntax'); | |||
require(path.join(common.fixturesDir, 'syntax/bad_syntax')); |
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.
Can you make 'syntax'
and 'bad_syntax'
separate arguments.
LGTM pending nits and the CI. |
Updating tests to use `common.fixturesDir` whenever possible/reasonable. Left out things like tests for `path` and `require.resolve`.
Alright, nits addressed and new CI: https://ci.nodejs.org/job/node-test-pull-request/2828/ |
Looks like FreeBSD on CI might have a stray process hogging One more CI run because the last two have been Not Good: https://ci.nodejs.org/job/node-test-pull-request/2829/ |
One more time. CI: https://ci.nodejs.org/job/node-test-pull-request/2896/ |
@bengl the CI is green. Feel free to move forward with this. |
Updating tests to use `common.fixturesDir` whenever possible/reasonable. Left out things like tests for `path` and `require.resolve`. PR-URL: #6997 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Landed in cc2a88a |
Updating tests to use `common.fixturesDir` whenever possible/reasonable. Left out things like tests for `path` and `require.resolve`. PR-URL: #6997 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@bengl would you be willing to backport to v4.x? |
ping @bengl |
I'm going to label this don't land. @bengl please feel free to backport |
Updating tests to use `common.fixturesDir` whenever possible/reasonable. Left out things like tests for `path` and `require.resolve`. PR-URL: #6997 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Updating tests to use `common.fixturesDir` whenever possible/reasonable. Left out things like tests for `path` and `require.resolve`. PR-URL: #6997 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Updating tests to use `common.fixturesDir` whenever possible/reasonable. Left out things like tests for `path` and `require.resolve`. PR-URL: #6997 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Updating tests to use `common.fixturesDir` whenever possible/reasonable. Left out things like tests for `path` and `require.resolve`. PR-URL: #6997 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Checklist
Affected core subsystem(s)
test
Description of change
Updating tests to use
common.fixturesDir
whenever possible/reasonable.Left out things like tests for
path
andrequire.resolve
.