Merge pull request #66 from eggplants/add_lint
Add test and lint workflow
This commit is contained in:
commit
34babd87a8
7 changed files with 44 additions and 12 deletions
16
.github/workflows/lint.yml
vendored
Normal file
16
.github/workflows/lint.yml
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
name: Lint
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Prettify code
|
||||
uses: creyD/prettier_action@v4.2
|
||||
with:
|
||||
prettier_options: --check src
|
16
.github/workflows/test.yml
vendored
Normal file
16
.github/workflows/test.yml
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
name: Test
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: |
|
||||
npm install
|
||||
- run: |
|
||||
npm run test
|
2
package-lock.json
generated
2
package-lock.json
generated
|
@ -28,7 +28,7 @@
|
|||
"devDependencies": {
|
||||
"autoprefixer": "^10.4.2",
|
||||
"postcss": "^8.4.5",
|
||||
"prettier": "^2.5.1",
|
||||
"prettier": "2.5.1",
|
||||
"tailwindcss": "^3.0.12"
|
||||
}
|
||||
},
|
||||
|
|
12
package.json
12
package.json
|
@ -21,10 +21,12 @@
|
|||
"react-countdown": "^2.3.2"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "react-scripts start",
|
||||
"build": "react-scripts build",
|
||||
"test": "react-scripts test",
|
||||
"eject": "react-scripts eject"
|
||||
"eject": "react-scripts eject",
|
||||
"fix": "prettier --write src",
|
||||
"lint": "prettier --check src",
|
||||
"start": "react-scripts start",
|
||||
"test": "react-scripts test"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": [
|
||||
|
@ -47,7 +49,7 @@
|
|||
"devDependencies": {
|
||||
"autoprefixer": "^10.4.2",
|
||||
"postcss": "^8.4.5",
|
||||
"tailwindcss": "^3.0.12",
|
||||
"prettier": "^2.5.1"
|
||||
"prettier": "2.5.1",
|
||||
"tailwindcss": "^3.0.12"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,8 +2,8 @@ import React from 'react'
|
|||
import { render, screen } from '@testing-library/react'
|
||||
import App from './App'
|
||||
|
||||
test('renders learn react link', () => {
|
||||
test('renders App component', () => {
|
||||
render(<App />)
|
||||
const linkElement = screen.getByText(/learn react/i)
|
||||
const linkElement = screen.getByText(/Not Wordle/)
|
||||
expect(linkElement).toBeInTheDocument()
|
||||
})
|
||||
|
|
|
@ -61,9 +61,7 @@ export const BaseModal = ({ title, children, isOpen, handleClose }: Props) => {
|
|||
>
|
||||
{title}
|
||||
</Dialog.Title>
|
||||
<div className="mt-2">
|
||||
{children}
|
||||
</div>
|
||||
<div className="mt-2">{children}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Reference in a new issue