generated from muratkeremozcan/react-cypress-ts-vite-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: configure development environment
- Loading branch information
1 parent
527ac3e
commit 560e745
Showing
23 changed files
with
77 additions
and
177 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 |
---|---|---|
|
@@ -3,4 +3,8 @@ build | |
coverage | ||
public | ||
.docz | ||
global | ||
global | ||
.prettierignore | ||
.eslintrc.js | ||
tsconfig.json | ||
.prettierrc |
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
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
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 |
---|---|---|
|
@@ -10,4 +10,4 @@ module.exports = { | |
'@typescript-eslint/no-var-requires': 'off', | ||
}, | ||
env: {'cypress/globals': 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 |
---|---|---|
@@ -1,7 +1 @@ | ||
describe('e2e sanity', () => { | ||
it('passes sanity', () => { | ||
cy.visit('/') | ||
cy.getByCy('count').contains('count is 0').dblclick().contains('count is 2') | ||
cy.task('log', 'e2e sanity passed') | ||
}) | ||
}) | ||
describe('e2e', () => {}); |
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
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,5 +1,5 @@ | ||
import '@testing-library/jest-dom/extend-expect' | ||
import '@testing-library/jest-dom/extend-expect'; | ||
|
||
import {configure} from '@testing-library/react' | ||
import { configure } from '@testing-library/react'; | ||
|
||
configure({testIdAttribute: 'data-cy'}) | ||
configure({ testIdAttribute: 'data-cy' }); |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,31 +1,3 @@ | ||
import {useState} from 'react' | ||
import './App.css' | ||
|
||
export default function App() { | ||
const [count, setCount] = useState(0) | ||
|
||
return ( | ||
<div className="App"> | ||
<div> | ||
<a href="https://vitejs.dev" target="_blank"> | ||
<img src="/vite.svg" className="logo" alt="Vite logo" /> | ||
</a> | ||
<a href="https://reactjs.org" target="_blank"> | ||
<img src="/react.svg" className="logo react" alt="React logo" /> | ||
</a> | ||
</div> | ||
<h1>Vite + React</h1> | ||
<div className="card"> | ||
<button data-cy="count" onClick={() => setCount(count => count + 1)}> | ||
count is {count} | ||
</button> | ||
<p> | ||
Edit <code>src/App.tsx</code> and save to test HMR | ||
</p> | ||
</div> | ||
<p className="read-the-docs"> | ||
Click on the Vite and React logos to learn more | ||
</p> | ||
</div> | ||
) | ||
return <div className="App">it works!</div>; | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,13 +1,14 @@ | ||
import React from 'react' | ||
import ReactDOM from 'react-dom/client' | ||
import './index.css' | ||
import App from './App' | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom/client'; | ||
import App from './App'; | ||
|
||
const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement) | ||
const root = ReactDOM.createRoot( | ||
document.getElementById('root') as HTMLElement, | ||
); | ||
root.render( | ||
<React.StrictMode> | ||
<App /> | ||
</React.StrictMode>, | ||
) | ||
); | ||
|
||
/* istanbul ignore file */ |
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 |
---|---|---|
@@ -1,11 +1,24 @@ | ||
import {defineConfig} from 'vite' | ||
import react from '@vitejs/plugin-react' | ||
import { defineConfig } from 'vite'; | ||
import react from '@vitejs/plugin-react'; | ||
|
||
// https://vitejs.dev/config/ | ||
export default defineConfig({ | ||
server: { | ||
port: 3000, | ||
host: true, | ||
}, | ||
resolve: { | ||
alias: { | ||
'@': '/src', | ||
'@components': '/src/components', | ||
'@pages': '/src/pages', | ||
'@routes': '/src/routes', | ||
'@utils': '/src/utils', | ||
'@hooks': '/src/hooks', | ||
'@assets': '/src/assets', | ||
'@types': '/src/types', | ||
'@services': '/src/services', | ||
}, | ||
}, | ||
plugins: [react()], | ||
}) | ||
}); |