Skip to content

Commit

Permalink
Migrate Tests part to TS
Browse files Browse the repository at this point in the history
  • Loading branch information
Tristan-WorkGH committed Dec 29, 2023
1 parent 3e985d6 commit 3e1ac2d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
11 changes: 11 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,18 @@
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --watchAll=false --transformIgnorePatterns \"node_modules/(?!@gridsuite/commons-ui)/\"",
"test": "react-scripts test --watchAll=false",
"test:watch": "react-scripts test",
"test:coverage": "react-scripts test --coverage",
"eject": "react-scripts eject"
},
"jest": {
"moduleNameMapper": {
"\\.svg": "<rootDir>/src/__mocks__/svgrMock.js"
}
},
"transformIgnorePatterns": [
"node_modules/(?!@gridsuite/commons-ui)/"
]
},
"eslintConfig": {
"extends": [
Expand All @@ -76,6 +81,7 @@
"devDependencies": {
"@types/eslint-config-prettier": "^6.11.3",
"@types/eslint-plugin-prettier": "^3.1.3",
"@types/jest": "^27.5.1",
"@types/prettier": "^2.0.2",
"eslint-config-prettier": "^8.0.0",
"eslint-plugin-prettier": "^4.0.0",
Expand Down
10 changes: 5 additions & 5 deletions src/components/app.test.js → src/components/app.test.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
// app.test.js
// app.test.tsx

import React from 'react';
import { createRoot } from 'react-dom/client';
import { act } from 'react-dom/test-utils';

import { IntlProvider } from 'react-intl';
import { Provider } from 'react-redux';
import { BrowserRouter } from 'react-router-dom';
import App from './app';
import { store } from '../redux/store';
import {
createTheme,
ThemeProvider,
StyledEngineProvider,
ThemeProvider,
} from '@mui/material/styles';
import { SnackbarProvider } from '@gridsuite/commons-ui';
import CssBaseline from '@mui/material/CssBaseline';
import { CssBaseline } from '@mui/material';

let container: Element | any = null;

let container = null;
beforeEach(() => {
// setup a DOM element as a render target
container = document.createElement('div');
Expand Down

0 comments on commit 3e1ac2d

Please sign in to comment.