test: improve clarity of ALS-enable-disable.js

The last als.run() will reactivate the als,
hence the test should test for getting the object,
not undefined

PR-URL: https://github.com/nodejs/node/pull/38008
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
Darkripper214 2021-04-01 00:28:25 +08:00 committed by Gerhard Stoebich
parent e79471deb7
commit e46c680bf2

View File

@ -24,8 +24,8 @@ asyncLocalStorage.run(new Map(), () => {
process.nextTick(() => {
assert.strictEqual(asyncLocalStorage.getStore(), undefined);
asyncLocalStorage.run(new Map(), () => {
assert.notStrictEqual(asyncLocalStorage.getStore(), undefined);
asyncLocalStorage.run(new Map().set('bar', 'foo'), () => {
assert.strictEqual(asyncLocalStorage.getStore().get('bar'), 'foo');
});
});
});