Skip to content

Commit

Permalink
Remove .only, add a lint rule to catch this in the future
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Brody committed Sep 7, 2024
1 parent c0ed188 commit 3efcaa2
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
9 changes: 9 additions & 0 deletions react/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import tseslint from 'typescript-eslint'
import reactPlugin from "eslint-plugin-react"
import preferFC from 'eslint-plugin-react-prefer-function-component/config'
import reactHooks from 'eslint-plugin-react-hooks'
import noOnlyTests from 'eslint-plugin-no-only-tests'

export default tseslint.config(
...tseslint.configs.strictTypeChecked,
Expand Down Expand Up @@ -107,4 +108,12 @@ export default tseslint.config(
},
},
},
{
plugins: {
'no-only-tests': noOnlyTests
},
rules: {
'no-only-tests/no-only-tests': 'error'
}
}
)
16 changes: 16 additions & 0 deletions react/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"eslint-import-resolver-typescript": "^3.6.3",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-no-only-tests": "^3.3.0",
"eslint-plugin-react": "^7.35.2",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-prefer-function-component": "^3.3.0",
Expand Down
2 changes: 1 addition & 1 deletion react/test/statistics_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ test('statistic-universe-selector-test', async (t) => {
fixture('statistic ascending')
.page(`${TARGET}/statistic.html?statname=Households+With+no+Vehicle+%25&article_type=Subnational+Region&start=21&amount=20&order=ascending&universe=USA`)

test.only('statistic-ascending-page', async (t) => {
test('statistic-ascending-page', async (t) => {
// We should see the state with the least vehicles, which is DC
await t.expect(Selector('div').withExactText('1').exists).ok()
await t.expect(Selector('div').withText('District of Columbia, USA').exists).ok()
Expand Down

0 comments on commit 3efcaa2

Please sign in to comment.