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: add coverage for vm: Module and SyntheticModule #31028

Closed

Conversation

@andrewkuzmenko
Copy link
Contributor

andrewkuzmenko commented Dec 19, 2019

code and learn task for additional coverage for situation when
creating an abstract instance of the Module and SyntheticModule throws exception if invalid params in constructor

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
@andrewkuzmenko andrewkuzmenko force-pushed the andrewkuzmenko:vm-module-basic-throws branch from c7c3ff4 to ec8dd28 Dec 19, 2019
@lpinca
lpinca approved these changes Dec 19, 2019
test/parallel/test-vm-module-basic.js Outdated Show resolved Hide resolved
@andrewkuzmenko andrewkuzmenko force-pushed the andrewkuzmenko:vm-module-basic-throws branch from ec8dd28 to 7e844e7 Dec 19, 2019
@ZYSzys
ZYSzys approved these changes Dec 20, 2019
@nodejs-github-bot

This comment has been minimized.

Test the impossibility of creating
an abstract instance of the Module.
Test of SyntheticModule to throw exception
if invalid params in constructor
Fix 'max-len','no-restricted-syntax'
(assert.throws must be envoken with at least two args)
and useless blank lines at the end of file
@andrewkuzmenko andrewkuzmenko force-pushed the andrewkuzmenko:vm-module-basic-throws branch from 7e844e7 to d2ff9fa Dec 20, 2019
@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

This comment has been minimized.

@Trott
Trott approved these changes Dec 20, 2019
@BridgeAR

This comment has been minimized.

Copy link
Member

BridgeAR commented Dec 20, 2019

Still LGTM

@andrewkuzmenko thanks for rebasing so quickly after the conflict! Just as a note: we mostly care about the error code and roughly check that the error message is indeed about the correct property. I personally suggest to use assert.throws() in the future instead of common.expectsError(). It was originally used at times when assert was not as powerful and as callback variation. The only real difference is the magically type property that common.expectsError supports.

@Trott

This comment has been minimized.

Copy link
Member

Trott commented Dec 22, 2019

Landed in ee14a64.

Thanks for the contribution! 🎉

@Trott Trott closed this Dec 22, 2019
Trott added a commit to Trott/io.js that referenced this pull request Dec 22, 2019
Test the impossibility of creating
an abstract instance of the Module.
Test of SyntheticModule to throw exception
if invalid params in constructor

PR-URL: nodejs#31028
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
BridgeAR added a commit that referenced this pull request Jan 3, 2020
Test the impossibility of creating
an abstract instance of the Module.
Test of SyntheticModule to throw exception
if invalid params in constructor

PR-URL: #31028
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@BridgeAR BridgeAR mentioned this pull request Jan 7, 2020
targos added a commit that referenced this pull request Jan 14, 2020
Test the impossibility of creating
an abstract instance of the Module.
Test of SyntheticModule to throw exception
if invalid params in constructor

PR-URL: #31028
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
9 participants
You can’t perform that action at this time.