Fixed tests

This commit is contained in:
Rishabh 2022-07-04 15:59:11 +02:00
parent a47dc6b7c2
commit c71db17200
4 changed files with 9 additions and 22 deletions

View File

@ -22,7 +22,7 @@
"build:combined": "node ./scripts/build-combined.js",
"build:bundle": "webpack --config webpack.config.js",
"test:ui": "react-scripts test",
"test": "yarn test --watchAll=false --coverage",
"test": "yarn test:ui --watchAll=false --coverage",
"eject": "react-scripts eject",
"lint": "eslint src --ext .js --cache",
"preship": "yarn lint",

View File

@ -1,11 +1,11 @@
import './App.css';
function App() {
return (
<div className="App">
Hello world
</div>
);
return (
<div className="App">
Hello world
</div>
);
}
export default App;

View File

@ -2,7 +2,7 @@ import { render, screen } from '@testing-library/react';
import App from './App';
test('renders learn react link', () => {
render(<App />);
const linkElement = screen.getByText(/learn react/i);
expect(linkElement).toBeInTheDocument();
render(<App />);
const linkElement = screen.getByText(/hello world/i);
expect(linkElement).toBeInTheDocument();
});

View File

@ -1,13 +0,0 @@
const reportWebVitals = onPerfEntry => {
if (onPerfEntry && onPerfEntry instanceof Function) {
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
getCLS(onPerfEntry);
getFID(onPerfEntry);
getFCP(onPerfEntry);
getLCP(onPerfEntry);
getTTFB(onPerfEntry);
});
}
};
export default reportWebVitals;