Skip to content

Commit

Permalink
Updated tests and incremented version
Browse files Browse the repository at this point in the history
  • Loading branch information
AsyncBanana committed Dec 26, 2021
1 parent c8d38c7 commit f0498ad
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "microdiff",
"version": "1.2.0",
"version": "1.3.0",
"description": "Small, fast, zero dependency deep object and array comparison",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
Expand Down
2 changes: 2 additions & 0 deletions tests/arrays.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ test("top level array & array diff", () => {
{
type: "REMOVE",
path: [1],
oldValue: "testing",
},
]);
});
Expand All @@ -32,6 +33,7 @@ test("object in array in object", () => {
type: "CHANGE",
path: ["test", 1, "test"],
value: false,
oldValue: true,
},
]
);
Expand Down
4 changes: 4 additions & 0 deletions tests/basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ test("change raw value", () => {
type: "CHANGE",
path: ["test"],
value: false,
oldValue: true,
},
]);
});
Expand All @@ -25,6 +26,7 @@ test("remove raw value", () => {
{
type: "REMOVE",
path: ["test2"],
oldValue: true,
},
]);
});
Expand All @@ -35,6 +37,7 @@ test("replace object with null", () => {
type: "CHANGE",
path: ["object"],
value: null,
oldValue: { test: true },
},
]);
});
Expand All @@ -45,6 +48,7 @@ test("replace object with other value", () => {
type: "CHANGE",
path: ["object"],
value: "string",
oldValue: { test: true },
},
]);
});
Expand Down
1 change: 1 addition & 0 deletions tests/class-primitives.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ test("Handles unequal number classes", () => {
type: "CHANGE",
path: ["number"],
value: 2,
oldValue: 1,
},
]);
});
Expand Down
3 changes: 3 additions & 0 deletions tests/dates.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ test("Handles unequal dates", () => {
path: ["date"],
type: "CHANGE",
value: new Date(2),
oldValue: new Date(1),
},
]);
});
Expand All @@ -20,13 +21,15 @@ test("Handles value being a date and the other not", () => {
path: ["date"],
type: "CHANGE",
value: "not date",
oldValue: new Date(1),
},
]);
assert.equal(diff({ date: "not date" }, { date: new Date(1) }), [
{
path: ["date"],
type: "CHANGE",
value: new Date(1),
oldValue: "not date",
},
]);
});
Expand Down
1 change: 1 addition & 0 deletions tests/regex.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ test("Handles unequal regex", () => {
type: "CHANGE",
path: ["regex"],
value: /b/,
oldValue: /a/,
},
]);
});
Expand Down

0 comments on commit f0498ad

Please sign in to comment.