Merge pull request #66 from eggplants/add_lint

Add test and lint workflow
This commit is contained in:
Hannah Park 2022-01-26 17:09:14 -05:00 committed by GitHub
commit 34babd87a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 44 additions and 12 deletions

16
.github/workflows/lint.yml vendored Normal file
View 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
View 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
View file

@ -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"
}
},

View file

@ -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"
}
}

View file

@ -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()
})

View file

@ -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>