Skip to content

Commit

Permalink
MNT Fix js tests
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Jan 12, 2023
1 parent d2e048c commit 9d52f82
Show file tree
Hide file tree
Showing 4 changed files with 1,468 additions and 1,079 deletions.
6 changes: 6 additions & 0 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"presets": [
"@babel/preset-env",
"@babel/preset-react"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,10 @@ describe('AssetDropzone', () => {
let item = null;

beforeEach(() => {
item = ReactTestUtils.renderIntoDocument(
<AssetDropzone {...props} />
);
item = new AssetDropzone();
});

it('should set this.dropzone to null', () => {
item.dropzone = 1;
item.constructor(props);

expect(item.dropzone).toBe(null);
});
});
Expand Down
12 changes: 4 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
],
"transform": {
".*": "babel-jest"
}
},
"testEnvironment": "jsdom"
},
"devDependencies": {
"@silverstripe/eslint-config": "^1.0.0-alpha6",
Expand Down Expand Up @@ -75,6 +76,7 @@
"graphql-fragments": "^0.1.0",
"graphql-tag": "^2.12.6",
"griddle-react": "^0.8.2",
"jest-environment-jsdom": "^29.3.1",
"merge": "^2.1.1",
"modernizr": "^3.12.0",
"prop-types": "^15.8.1",
Expand All @@ -99,11 +101,5 @@
},
"browserslist": [
"defaults"
],
"babel": {
"presets": [
"@babel/preset-env",
"@babel/preset-react"
]
}
]
}
Loading

0 comments on commit 9d52f82

Please sign in to comment.