Skip to content

Commit

Permalink
Fix/tests (react-grid-layout#908)
Browse files Browse the repository at this point in the history
* fix(test): fix jsdom error w/jest

* fix(test): ensure TimSort in Node 11+ doesn't break our tests

The test shouldn't depend on the runtime's Array#sort internals
  • Loading branch information
STRML authored Feb 2, 2019
1 parent aa5af3c commit 80873c8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@
"jest": {
"testMatch": [
"<rootDir>/test/spec/*.js"
]
],
"testURL": "http://localhost"
},
"lint-staged": {
"*.{js,jsx}": [
Expand Down
4 changes: 2 additions & 2 deletions test/spec/utils-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -398,14 +398,14 @@ describe("compact horizontal", () => {
it("Handles recursive collision by moving new collisions out of the way before moving item to the right", () => {
const layout = [
{ y: 0, x: 0, h: 2, w: 5, i: "1" },
{ y: 0, x: 0, h: 10, w: 1, i: "2" },
{ y: 1, x: 0, h: 10, w: 1, i: "2" },
{ y: 5, x: 1, h: 1, w: 1, i: "3" },
{ y: 5, x: 2, h: 1, w: 1, i: "4" },
{ y: 5, x: 2, h: 1, w: 1, i: "5", static: true }
];
expect(compact(layout, "horizontal", 10)).toEqual([
{ y: 0, x: 0, h: 2, w: 5, i: "1", moved: false, static: false },
{ y: 0, x: 5, h: 10, w: 1, i: "2", moved: false, static: false },
{ y: 1, x: 5, h: 10, w: 1, i: "2", moved: false, static: false },
{ y: 5, x: 6, h: 1, w: 1, i: "3", moved: false, static: false },
{ y: 5, x: 7, h: 1, w: 1, i: "4", moved: false, static: false },
{ y: 5, x: 2, h: 1, w: 1, i: "5", moved: false, static: true }
Expand Down

0 comments on commit 80873c8

Please sign in to comment.