From 4d50975cd7357787761e3ddd89e51bf2ef6bfa0a Mon Sep 17 00:00:00 2001 From: Darkripper214 Date: Thu, 1 Apr 2021 00:28:25 +0800 Subject: [PATCH] test: improve clarity of ALS-enable-disable.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-By: James M Snell Reviewed-By: Colin Ihrig --- test/async-hooks/test-async-local-storage-enable-disable.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/async-hooks/test-async-local-storage-enable-disable.js b/test/async-hooks/test-async-local-storage-enable-disable.js index 15ab2f5d9ebbb2..c7248d6cec40a8 100644 --- a/test/async-hooks/test-async-local-storage-enable-disable.js +++ b/test/async-hooks/test-async-local-storage-enable-disable.js @@ -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'); }); }); });