-
Notifications
You must be signed in to change notification settings - Fork 15
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
Newrelic 3123/esm test loader #141
Merged
mrickard
merged 8 commits into
newrelic:main
from
mrickard:NEWRELIC-3123/esm-test-loader
Sep 14, 2022
Merged
Changes from 2 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
cada6a6
Added JetBrains config to .gitignore
mrickard 9de8e84
Get dependency type from package.json and use alternate loader for mo…
mrickard 982da86
Corrected loader argument to cp/.spawn and allowed for loader to be d…
mrickard 69a7cc2
Updated to use test loader, and renamed loader env var to NR_LOADER
mrickard 334a69a
Refactored to supply loader from test.js, before spawn
mrickard 8fa5bea
added unit tests for the loader logic in lib/versioned/test.js
bizob2828 683f724
cleaned up logic in runner for determining when to use loader
bizob2828 d857dd7
restored a file i removed
bizob2828 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,5 +29,8 @@ node_modules | |
# VS Code settings | ||
.vscode | ||
|
||
# JetBrains settings | ||
.idea | ||
|
||
# Instanbul code coverage files | ||
.nyc_output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,6 +80,7 @@ function Test(directory, pkgVersions, opts = {}) { | |
this.duration = 0 | ||
this.allPkgs = !!allPkgs | ||
this.strict = !!opts.strict | ||
this.type = pkg.type | ||
mrickard marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we have unit test for this file, might be good to add some assertions around type. |
||
} | ||
|
||
Test.prototype.next = function next() { | ||
|
@@ -102,7 +103,6 @@ Test.prototype.peek = function peek() { | |
|
||
Test.prototype.run = function run() { | ||
const task = this.next() | ||
|
||
if (!task) { | ||
return null | ||
} | ||
|
@@ -129,7 +129,8 @@ Test.prototype.run = function run() { | |
// Spawn another runner instance with list of packages to install | ||
const child = cp.spawn('node', [TEST_EXECUTOR, task.test].concat(pkgList), { | ||
cwd: this.directory, | ||
stdio: ['ignore', 'pipe', 'pipe', 'ipc'] | ||
stdio: ['ignore', 'pipe', 'pipe', 'ipc'], | ||
env: { ...process.env, packageType: this.type } | ||
}) | ||
|
||
const testRun = new TestRun(child, pkgs.length > 0) | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
thinking more of this we could just default the type in lib/versioned/test.js to
commonjs
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 initially did do that--it's easy enough to restore!