Skip to content

Commit 10ad009

Browse files
committed
Update tests
1 parent ca7fafd commit 10ad009

File tree

1 file changed

+9
-20
lines changed

1 file changed

+9
-20
lines changed

tests/nan.js

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { test } from "uvu";
2-
import * as assert from "uvu/assert";
1+
import test from "node:test";
2+
import assert from "node:assert";
33
import diff from "../dist/index.js";
44

55
test("new NaN value in object", () => {
6-
assert.equal(diff({}, { testNaN: NaN }), [
6+
assert.deepStrictEqual(diff({}, { testNaN: NaN }), [
77
{
88
type: "CREATE",
99
path: ["testNaN"],
@@ -12,7 +12,7 @@ test("new NaN value in object", () => {
1212
]);
1313
});
1414
test("change NaN value in object", () => {
15-
assert.equal(diff({ testNaN: NaN }, { testNaN: 0 }), [
15+
assert.deepStrictEqual(diff({ testNaN: NaN }, { testNaN: 0 }), [
1616
{
1717
type: "CHANGE",
1818
path: ["testNaN"],
@@ -22,10 +22,10 @@ test("change NaN value in object", () => {
2222
]);
2323
});
2424
test("do not change NaN value in object", () => {
25-
assert.equal(diff({ testNaN: NaN }, { testNaN: NaN }), []);
25+
assert.deepStrictEqual(diff({ testNaN: NaN }, { testNaN: NaN }), []);
2626
});
2727
test("remove NaN value in object", () => {
28-
assert.equal(diff({ testNaN: NaN }, {}), [
28+
assert.deepStrictEqual(diff({ testNaN: NaN }, {}), [
2929
{
3030
type: "REMOVE",
3131
path: ["testNaN"],
@@ -34,7 +34,7 @@ test("remove NaN value in object", () => {
3434
]);
3535
});
3636
test("new NaN value in array", () => {
37-
assert.equal(diff([], [ NaN ]), [
37+
assert.deepStrictEqual(diff([], [NaN]), [
3838
{
3939
type: "CREATE",
4040
path: [0],
@@ -43,7 +43,7 @@ test("new NaN value in array", () => {
4343
]);
4444
});
4545
test("change NaN value in object", () => {
46-
assert.equal(diff([ NaN ], [ 0 ]), [
46+
assert.deepStrictEqual(diff([NaN], [0]), [
4747
{
4848
type: "CHANGE",
4949
path: [0],
@@ -53,16 +53,5 @@ test("change NaN value in object", () => {
5353
]);
5454
});
5555
test("do not change NaN value in array", () => {
56-
assert.equal(diff([ NaN ], [ NaN ]), []);
56+
assert.deepStrictEqual(diff([NaN], [NaN]), []);
5757
});
58-
test("remove NaN value in array", () => {
59-
assert.equal(diff([ NaN ], []), [
60-
{
61-
type: "REMOVE",
62-
path: [0],
63-
oldValue: NaN,
64-
},
65-
]);
66-
});
67-
68-
test.run();

0 commit comments

Comments
 (0)