From 29bf21af39e0d372cc39d6437924dc6dde3d6579 Mon Sep 17 00:00:00 2001 From: vishal diyora Date: Sat, 16 Mar 2024 18:31:54 -0400 Subject: [PATCH] Update test file format and fix test name --- test/test1889.js | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/test/test1889.js b/test/test1889.js index 2888c8cfa0..15eb8abf5f 100644 --- a/test/test1889.js +++ b/test/test1889.js @@ -8,31 +8,31 @@ var test = '1889'; // insert test file number describe('Test 1889 - Ensure utils.isNode handles node and non-Node environments', function () { let originalProcess; - before(function() { - // Store the original process object - originalProcess = global.process; - }); + before(function () { + // Store the original process object + originalProcess = global.process; + }); - after(function() { - // Restore the original process object after all tests - global.process = originalProcess; - }); + after(function () { + // Restore the original process object after all tests + global.process = originalProcess; + }); it('Positive: Detect Node environment', function () { - // No modification needed here, running in actual Node.js environment - const isNode = alasql.utils.isNode; - assert.strictEqual(isNode, true, 'utils.isNode should return true in a Node.js environment'); + // No modification needed here, running in actual Node.js environment + const isNode = alasql.utils.isNode; + assert.strictEqual(isNode, true, 'utils.isNode should return true in a Node.js environment'); }); - it('Negative: Detect Node environment', function () { + it('Negative: Should not detect as Node environment', function () { // Temporarily override the global process object - global.process = null; + global.process = null; delete require.cache[require.resolve('..')]; const reloadedAlasql = require('..'); const isNodeAfterModification = reloadedAlasql.utils.isNode; - assert.strictEqual(isNodeAfterModification, false, 'utils.isNode should return true in a Node.js environment'); - }); + assert.strictEqual(isNodeAfterModification, false, 'utils.isNode should return false when not in nodejs environment'); + }); });