Skip to content

Commit 968cbbf

Browse files
committed
nits
1 parent 76f4703 commit 968cbbf

2 files changed

Lines changed: 9 additions & 14 deletions

File tree

doc/api/test.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1757,8 +1757,11 @@ added: REPLACEME
17571757
-->
17581758

17591759
An object whose methods are used to configure available assertions on the
1760-
`TestContext` objects in the current process. It is possible to apply the same
1761-
configuration to all files by placing common configuration code in a module
1760+
`TestContext` objects in the current process. The methods from `node:assert`
1761+
and snapshot testing functions are available by default.
1762+
1763+
It is possible to apply the same configuration to all files by placing common
1764+
configuration code in a module
17621765
preloaded with `--require` or `--import`.
17631766

17641767
### `assert.register(name, fn)`

lib/test.js

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,22 +62,14 @@ ObjectDefineProperty(module.exports, 'snapshot', {
6262
},
6363
});
6464

65-
let lazyAssert;
66-
6765
ObjectDefineProperty(module.exports, 'assert', {
6866
__proto__: null,
6967
configurable: true,
7068
enumerable: true,
7169
get() {
72-
if (lazyAssert === undefined) {
73-
const { register } = require('internal/test_runner/assert');
74-
75-
lazyAssert = {
76-
__proto__: null,
77-
register,
78-
};
79-
}
80-
81-
return lazyAssert;
70+
const { register } = require('internal/test_runner/assert');
71+
const assert = { __proto__: null, register };
72+
ObjectDefineProperty(module.exports, 'assert', assert);
73+
return assert;
8274
},
8375
});

0 commit comments

Comments
 (0)