You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code can be run in both Deno and Node: in Deno -0 and 0 are deepStrictEqual, in Node are not. In both environments -0 and 0 are notStrictEqual.
import { test } from 'node:test';
import assert from 'node:assert';
test('negative zero test', () => {
// Deno & Node: strict equal: NOT equal
assert.notStrictEqual(-0, 0);
// Deno: deepStrictEqual: equal
// Node: deepStrictEqual: NOT equal
if (typeof Deno !== 'undefined') {
assert.deepStrictEqual(-0, 0);
} else {
assert.notDeepStrictEqual(-0, 0);
}
});