test: improve disable AsyncLocalStorage test

PR-URL: https://github.com/nodejs/node/pull/31998
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
pull/32024/head
Andrey Pechkurov 2020-02-28 10:07:47 +03:00 committed by vdeturckheim
parent 4c35b62f64
commit 68e36ade3d
No known key found for this signature in database
GPG Key ID: 78A7A2EB0AA81A1B
1 changed files with 3 additions and 0 deletions

View File

@ -9,6 +9,9 @@ asyncLocalStorage.runSyncAndReturn(new Map(), () => {
asyncLocalStorage.getStore().set('foo', 'bar');
process.nextTick(() => {
assert.strictEqual(asyncLocalStorage.getStore().get('foo'), 'bar');
process.nextTick(() => {
assert.strictEqual(asyncLocalStorage.getStore(), undefined);
});
asyncLocalStorage.disable();
assert.strictEqual(asyncLocalStorage.getStore(), undefined);
process.nextTick(() => {