Navigation Menu

Skip to content

Commit

Permalink
feat: support @jest/globals (#1094)
Browse files Browse the repository at this point in the history
* test: add initial cases

* refactor: simplify `isTestCaseCall` & `isDescribeCall` utilities

* feat: check that test functions are probably from jest

* feat: apply to `isDescribeCall` too

* fix: check import refs before unresolved refs

* test: add utils cases

* fix: begin to support variable imports

* test(expect-expect): more tests

* test: set correct `ecmaVersion`

* chore: clean

* chore: clean up code & tests more

* feat: support dynamic import properly

* fix: make sure that `scopeHasLocalReferences` works properly

* test: add extra case for coverage

* feat: switch rules over to using scoped jest function checks

* fix: remove unneeded condition (apparently?)

* fix: adjust code to cover branches

* test: only run dynamic import cases when using eslint 8+

* test: ignore coverage on condition that is only tested on eslint v8

* ci: only collect coverage when using eslint versions that support dynamic import

* feat: convert `isHook` to `isHookCall`

* chore: remove unneeded exporting of util function

* refactor(expect-expect): reuse `scope`

* refactor: compare against `null` instead of casting to boolean

* chore: mark array param as readonly

* test: move utils case from specific rule tests into utils tests

* refactor: rename variable

* test: add some more cases

* chore: remove duplicated test case

* test: let original error throw if eslint cannot be found

* chore: upgrade `@typescript-eslint/types`
  • Loading branch information
G-Rath committed May 13, 2022
1 parent 48e994f commit 84d7a68
Show file tree
Hide file tree
Showing 29 changed files with 1,146 additions and 238 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/nodejs.yml
Expand Up @@ -85,11 +85,12 @@ jobs:
yarn
yarn add --dev eslint@${{ matrix.eslint-version }}
- name: run tests
run: yarn test --coverage
# only collect coverage on eslint versions that support dynamic import
run: yarn test --coverage ${{ matrix.eslint-version >= 8 }}
env:
CI: true
- uses: codecov/codecov-action@v3
if: always()
if: ${{ matrix.eslint-version >= 8 }}
test-os:
name: Test on ${{ matrix.os }} using Node.js LTS
needs: prepare-yarn-cache
Expand All @@ -108,11 +109,12 @@ jobs:
- name: install
run: yarn
- name: run tests
run: yarn test --coverage
# only collect coverage on eslint versions that support dynamic import
run: yarn test --coverage ${{ matrix.eslint-version >= 8 }}
env:
CI: true
- uses: codecov/codecov-action@v3
if: always()
if: ${{ matrix.eslint-version >= 8 }}

docs:
if: ${{ github.event_name == 'pull_request' }}
Expand Down

0 comments on commit 84d7a68

Please sign in to comment.