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

test: invalid package.json causes error when require()ing in directory #10044

Closed
wants to merge 1 commit into from
Closed

test: invalid package.json causes error when require()ing in directory #10044

wants to merge 1 commit into from

Conversation

samshull
Copy link

@samshull samshull commented Dec 1, 2016

Checklist
  • make -j8 test (UNIX), or vcbuild test nosign (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

test

Description of change

Requiring a file from a directory that contains an invalid package.json
file should throw an error.

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Dec 1, 2016
@imyller imyller added the module Issues and PRs related to the module subsystem. label Dec 1, 2016
@Trott Trott added the code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. label Dec 2, 2016
Copy link
Member

@Trott Trott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM if CI is ✅ . Might be slightly better if the RegExp used ^ and $ to match the whole message, but I'm fine with this as is.

@Trott
Copy link
Member

Trott commented Dec 2, 2016

Copy link
Contributor

@cjihrig cjihrig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I'd like another CI run: https://ci.nodejs.org/job/node-test-pull-request/5140/

@@ -69,6 +69,9 @@ assert.strictEqual(threeFolder, threeIndex);
assert.notStrictEqual(threeFolder, three);

console.error('test package.json require() loading');
assert.throws(function() {
require('../fixtures/packages/invalid');
}, /package.json: Unexpected token/);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be better to test the entire error message here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the benefit of full text message checking?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We treat changes to error messages as breaking changes. So, it's a good way to detect if anything changes.

Copy link
Member

@jasnell jasnell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small nit but LGTM

Requiring a file from a directory that contains an invalid package.json
file should throw an error.
@Trott
Copy link
Member

Trott commented Dec 7, 2016

I made the RegExp more strict. CI: https://ci.nodejs.org/job/node-test-pull-request/5282/

@italoacasas
Copy link
Contributor

Landed in: 4f486aa

Thanks for the contribution

@italoacasas italoacasas closed this Dec 7, 2016
addaleax pushed a commit that referenced this pull request Dec 8, 2016
Requiring a file from a directory that contains an invalid package.json
file should throw an error.

PR-URL: #10044
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@italoacasas italoacasas mentioned this pull request Dec 15, 2016
targos pushed a commit that referenced this pull request Dec 26, 2016
Requiring a file from a directory that contains an invalid package.json
file should throw an error.

PR-URL: #10044
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@MylesBorins MylesBorins mentioned this pull request Dec 27, 2016
targos pushed a commit that referenced this pull request Dec 28, 2016
Requiring a file from a directory that contains an invalid package.json
file should throw an error.

PR-URL: #10044
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
targos pushed a commit that referenced this pull request Jan 23, 2017
Requiring a file from a directory that contains an invalid package.json
file should throw an error.

PR-URL: #10044
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
MylesBorins pushed a commit that referenced this pull request Jan 24, 2017
Requiring a file from a directory that contains an invalid package.json
file should throw an error.

PR-URL: #10044
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@MylesBorins MylesBorins mentioned this pull request Jan 24, 2017
MylesBorins pushed a commit that referenced this pull request Feb 1, 2017
Requiring a file from a directory that contains an invalid package.json
file should throw an error.

PR-URL: #10044
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
AdamMajer added a commit to AdamMajer/node that referenced this pull request Feb 28, 2020
OpenSSL 1.1.1d does not ship with getrandom syscall being
predefined on all architectures. So when NodeJS is run with glibc
prior to 2.25, where getentropy is unavailable, and the getrandom
syscall is unknown, it will fail. PPC64LE or s390 are affected
by lack of this definition.

Original commit message.

    commit 4dcb150ea30f9bbfa7946e6b39c30a86aca5ed02
    Author: Kurt Roeckx <[email protected]>
    Date:   Sat Sep 28 14:59:32 2019 +0200

      Add defines for __NR_getrandom for all Linux architectures

      Fixes: nodejs#10015

      Reviewed-by: Bernd Edlinger <[email protected]>
      GH: nodejs#10044

Fixes: nodejs#31671
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. module Issues and PRs related to the module subsystem. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants