Update Dec 10, 2024 tracked by Updatify
2024-12-10, Version 23.4.0 (Current), @aduh95 prepared by @targos
Notable Changes
Introducing experimental assert.partialDeepStrictEqual
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:
assert.partialDeepStrictEqual(
{ a: 1, b: 2, c: 3 },
{ a: 1, b: 2 },
);
assert.partialDeepStrictEqual(
[1, 2, 3, 4],
[2, 3],
);
assert.partialDeepStrictEqual(
{ a: { b: { c: 1, d: 2 } }, e: 3 },
{ a: { b: { c: 1 } } },
);
assert.partialDeepStrictEqual(
{ a: { b: { c: 1, d: 2 } }, e: 3 },
{ a: { b: { c: 1 } } },
);
assert.partialDeepStrictEqual(
new Set([{ a: 1 }, { b: 1 }]),
new Set([{ a: 1 }]),
);
assert.partialDeepStrictEqual(
{ a: new Set([{ a: 1 }, { b: 1 }]), b: new Map(), c: [1, 2, 3] },
{ a: new Set([{ a: 1 }]), c: [2] },
);
Contributed by Giovanni Bucci in #54630.
Implement --trace-env and --trace-env-[js|native]-stack
This release introduces --trace-env, --trace-env-js-stack and --trace-env-native-stack