-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
1,607 additions
and
7,116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
SERVER_OPEN_BROWSER=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
node_modules/ | ||
# Ignore artifacts: | ||
build/ | ||
coverage/ | ||
|
||
vite-env.d.ts | ||
vite.config.ts | ||
jest.config.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,3 +26,6 @@ | |
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log\* | ||
|
||
yarn.lock | ||
package-lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<link rel="icon" href="/favicon.ico" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<meta name="theme-color" content="#000000" /> | ||
<meta name="description" content="Web site created using Vite" /> | ||
<link rel="apple-touch-icon" href="/logo192.png" /> | ||
<link rel="manifest" href="/manifest.json" /> | ||
<title>React App</title> | ||
</head> | ||
<body> | ||
<noscript>You need to enable JavaScript to run this app.</noscript> | ||
<script type="module" src="/src/index.tsx"></script> | ||
<div id="root"></div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module.exports = { | ||
roots: ['<rootDir>/src'], | ||
transform: { | ||
'^.+\\.tsx$': 'ts-jest', | ||
'^.+\\.ts$': 'ts-jest' | ||
}, | ||
testRegex: '(/__tests__/.*.(test|spec)).(jsx?|tsx?)$', | ||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'], | ||
collectCoverage: true, | ||
collectCoverageFrom: ['<rootDir>/src/**/*.{ts,tsx}'], | ||
coverageDirectory: '<rootDir>/coverage/', | ||
coveragePathIgnorePatterns: ['(tests/.*.mock).(jsx?|tsx?)$', '(.*).d.ts$'], | ||
moduleNameMapper: { | ||
'.+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2|svg)$': 'identity-obj-proxy' | ||
}, | ||
verbose: true, | ||
testTimeout: 30000 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,60 @@ | ||
{ | ||
"name": "vite-complete-react-app", | ||
"version": "0.1.0", | ||
"private": true, | ||
"dependencies": { | ||
"@reduxjs/toolkit": "^2.2.2", | ||
"@testing-library/jest-dom": "^6.4.2", | ||
"@testing-library/react": "^14.2.2", | ||
"@testing-library/user-event": "^14.5.2", | ||
"axios": "^1.6.8", | ||
"eslint-plugin-prettier": "^5.1.3", | ||
"moment": "^2.30.1", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"react-redux": "^9.1.0", | ||
"react-router-dom": "^6.22.3", | ||
"react-scripts": "5.0.1", | ||
"redux-persist": "^6.0.0", | ||
"sass": "^1.72.0", | ||
"sass-loader": "^14.1.1" | ||
}, | ||
"scripts": { | ||
"start": "react-scripts start", | ||
"build": "react-scripts build", | ||
"test": "react-scripts test", | ||
"eject": "react-scripts eject", | ||
"lint": "eslint --cache .", | ||
"format": "prettier --check ." | ||
}, | ||
"eslintConfig": { | ||
"extends": "react-app" | ||
}, | ||
"browserslist": [ | ||
"defaults", | ||
"not IE 11" | ||
], | ||
"devDependencies": { | ||
"@types/jest": "^29.5.12", | ||
"@types/node": "^20.11.30", | ||
"@types/react": "^18.2.67", | ||
"@types/react-dom": "^18.2.22", | ||
"@types/react-redux": "^7.1.33", | ||
"typescript": "^5.4.3" | ||
}, | ||
"overrides": { | ||
"react-scripts": { | ||
"typescript": "^5" | ||
} | ||
}, | ||
"homepage": ".", | ||
"postcss": { | ||
"plugins": { | ||
"autoprefixer": {} | ||
} | ||
} | ||
"name": "vite-complete-react-app", | ||
"version": "1.0.0", | ||
"type": "module", | ||
"author": { | ||
"name": "Cristiano Raimondi", | ||
"url": "https://github.com/chrisuser" | ||
}, | ||
"dependencies": { | ||
"@reduxjs/toolkit": "^2.2.2", | ||
"@testing-library/jest-dom": "^6.4.2", | ||
"@testing-library/react": "^14.2.2", | ||
"@testing-library/user-event": "^14.5.2", | ||
"axios": "^1.6.8", | ||
"eslint-plugin-prettier": "^5.1.3", | ||
"moment": "^2.30.1", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"react-redux": "^9.1.0", | ||
"react-router-dom": "^6.22.3", | ||
"redux-persist": "^6.0.0", | ||
"sass": "^1.72.0", | ||
"sass-loader": "^14.1.1" | ||
}, | ||
"scripts": { | ||
"start": "vite --port 3000 --open", | ||
"dev": "vite --port 3000 --open", | ||
"build": "vite build", | ||
"serve": "vite preview --open", | ||
"test": "jest", | ||
"test:coverage": "jest --silent --watchAll=false --coverage", | ||
"lint": "eslint --cache .", | ||
"format": "prettier --check ." | ||
}, | ||
"eslintConfig": { | ||
"extends": "react-app" | ||
}, | ||
"browserslist": [ | ||
"defaults", | ||
"not IE 11" | ||
], | ||
"devDependencies": { | ||
"@types/jest": "^29.5.12", | ||
"@types/node": "^20.11.30", | ||
"@types/react": "^18.2.67", | ||
"@types/react-dom": "^18.2.22", | ||
"@types/react-redux": "^7.1.33", | ||
"@vitejs/plugin-react": "^4.2.1", | ||
"identity-obj-proxy": "^3.0.0", | ||
"jest": "^29.7.0", | ||
"jest-environment-jsdom": "^29.7.0", | ||
"ts-jest": "^29.1.2", | ||
"typescript": "^5.4.3", | ||
"vite": "^5.2.4", | ||
"vite-plugin-env-compatible": "^2.0.1", | ||
"vite-plugin-html": "^3.2.2", | ||
"vitest": "^1.4.0" | ||
}, | ||
"homepage": "." | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/** | ||
* @jest-environment jsdom | ||
*/ | ||
import { render, screen, waitFor } from '@testing-library/react' | ||
import '@testing-library/jest-dom' | ||
import DateDisplay from '../../components/DateDisplay' | ||
|
||
test('renders current date', () => { | ||
render(<DateDisplay />) | ||
;async () => { | ||
const timeFormat = screen.getByText(/GMT/i) | ||
await waitFor(() => expect(timeFormat).toBeInTheDocument()) | ||
} | ||
}) |
4 changes: 4 additions & 0 deletions
4
src/tests/pages/HomePage.test.tsx → src/__tests__/pages/HomePage.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
src/tests/pages/NotFoundPage.test.tsx → src/__tests__/pages/NotFoundPage.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
import '@testing-library/jest-dom' | ||
import { expect, afterEach } from 'vitest' | ||
import { cleanup } from '@testing-library/react' | ||
import * as matchers from '@testing-library/jest-dom/matchers' | ||
|
||
expect.extend(matchers) | ||
afterEach(cleanup) |
Oops, something went wrong.