Node.js® is a free, open-source, cross-platform JavaScript runtime environment that lets developers create servers, web apps, command line tools and scripts.
Published By From Node.js News · 1 min read
ReleaseNode.js 23.4.0 (Current)
Sometimes, when writing test, we want to validate that some specific properties are present, and the mere presence of additional keys are not exactly relevant for that specific test. For this use case, we can now use assert.partialDeepStrictEqual , which should be familiar to those already using assert.deepStrictEqual , with the main difference that it does not require all properties in the actual parameter to be present in the expected parameter.
Here are a few examples of usage:
Contributed by Giovanni Bucci in #54630 .
This release introduces --trace-env , --trace-env-js-stack and --trace-env-native-stack CLI options that print information about any access to environment variables done in the current Node.js instance to stderr.
This is an excerpt. The full article is published by Node.js News.
Answers to common questions regarding this article's topic, architecture, and practical applications.
Sometimes, when writing test, we want to validate that some specific properties are present, and the mere presence of additional keys are not exactly relevant for that specific test. For this use case, we can now use assert.partialDeepStrictEqual, which should be familiar to those already using assert.deepStrictEqual, with the main difference that it does not require all properties in the actual parameter to be present in the expected parameter.
How It Works
[ 59d6891872 ] - doc : add LJHarb to collaborators (Jordan Harband) #56132 [ 565b04a7be ] - (SEMVER-MINOR) net : add BlockList.isBlockList(value) (James M Snell) #56078 [ c9698ed6a4 ] - (SEMVER-MINOR) net : support blockList in net.connect (theanarkh) #56075 [ 30d604180d ] - (SEMVER-MINOR) net : support blockList in net.Server (theanarkh) #56079 [ 9fba5e1df1 ] - (SEMVER-MINOR) net : add SocketAddress.parse (James M Snell) #56076 [ 4cdb03201e ] -
General
This release introduces --trace-env, --trace-env-js-stack and --trace-env-native-stack
CLI options that print information about any access to environment variables done in the current
Node.js instance to stderr. Currently in the logs, only the names of the environment variables
being accessed are printed, while the values are not printed to avoid leaking sensitive
information. To print the stack trace of the access, use --trace-env-js-stack and/o
General
Sometimes, when writing test, we want to validate that some specific properties
are present, and the mere presence of additional keys are not exactly relevant
for that specific test. For this use case, we can now use
assert.partialDeepStrictEqual, which should be familiar to those already using
assert.deepStrictEqual, with the main difference that it does not require all
properties in the actual parameter to be present in the expected parameter.