From c6679e2686df8f95cb18424265da4e405f1f3cba Mon Sep 17 00:00:00 2001 From: wellwelwel <46850407+wellwelwel@users.noreply.github.com> Date: Wed, 11 Sep 2024 05:20:51 -0300 Subject: [PATCH] ci: add tests --- test/integration/strict/ensure-strict.test.ts | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 test/integration/strict/ensure-strict.test.ts diff --git a/test/integration/strict/ensure-strict.test.ts b/test/integration/strict/ensure-strict.test.ts new file mode 100644 index 00000000..035d9a42 --- /dev/null +++ b/test/integration/strict/ensure-strict.test.ts @@ -0,0 +1,20 @@ +import { skip } from '../../../src/modules/helpers/skip.js'; +import { getRuntime, nodeVersion } from '../../../src/parsers/get-runtime.js'; +import { describe } from '../../../src/modules/helpers/describe.js'; +import { assert } from '../../../src/modules/essentials/assert.js'; + +if ((nodeVersion && nodeVersion < 16) || getRuntime() === 'deno') { + skip('Strict method is available from Node.js 16'); +} + +describe('Ensure strict', async () => { + const { strict } = await import('../../../src/modules/essentials/strict.js'); + + const actual = Object.create(null); + const expected = { name: 'John' }; + + actual.name = 'John'; + + assert.deepEqual(actual, expected); + strict.notDeepEqual(actual, expected); +});