Skip to content

Commit

Permalink
Adds an E2E test for TypeScript ESLint (#669)
Browse files Browse the repository at this point in the history
* Adds an E2E test for TypeScript ESLint

**What's the problem this PR addresses?**

#368 - Adding one basic test for ESLint with `typescript-eslint`

* Moves the ESLint-TS workflow in the ESLint workflow

* Updates the workflows

* Resetup E2E for typescript-eslint integration test

Co-authored-by: Maël Nison <nison.mael@gmail.com>
  • Loading branch information
SamChou19815 and arcanis committed Jan 15, 2020
1 parent 97703c9 commit 4499649
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/e2e-eslint-workflow.yml
Expand Up @@ -41,3 +41,18 @@ jobs:
echo '42' | tee ko.js
! yarn eslint ko.js
- name: 'Running the TypeScript integration test'
run: |
source scripts/e2e-setup-ci.sh
yarn init -p
yarn add eslint typescript @typescript-eslint/parser @typescript-eslint/eslint-plugin
echo '{"parser": "@typescript-eslint/parser", "plugins": ["@typescript-eslint"], "rules": {"@typescript-eslint/explicit-function-return-type": "error"}}' > .eslintrc
echo 'const f = (): number => 42;' | tee ok.ts
yarn eslint ok.ts
echo 'const f = () => 42;' | tee ko.ts
! yarn eslint ko.ts
11 changes: 1 addition & 10 deletions .github/workflows/e2e-typescript-workflow.yml
Expand Up @@ -26,23 +26,14 @@ jobs:
- name: 'Build the standard bundle'
run: |
node ./scripts/run-yarn.js build:cli
node ./scripts/run-yarn workspace @yarnpkg/fslib pack
node ./scripts/run-yarn workspace @yarnpkg/libzip pack
node ./scripts/run-yarn workspace @yarnpkg/pnpify pack
- name: 'Running the integration test'
run: |
source scripts/e2e-setup-ci.sh
yarn init -p
yarn add typescript
jq '.resolutions["@yarnpkg/fslib"] = "file:'"$GITHUB_WORKSPACE"'/packages/yarnpkg-fslib/package.tgz"' <<< "$(cat package.json)" > package.json
jq '.resolutions["@yarnpkg/libzip"] = "file:'"$GITHUB_WORKSPACE"'/packages/yarnpkg-libzip/package.tgz"' <<< "$(cat package.json)" > package.json
jq '.resolutions["@yarnpkg/pnpify"] = "file:'"$GITHUB_WORKSPACE"'/packages/yarnpkg-pnpify/package.tgz"' <<< "$(cat package.json)" > package.json
jq '.scripts.tsc = "pnpify tsc"' <<< "$(cat package.json)" > package.json
yarn add typescript @yarnpkg/pnpify@*
yarn add ts-pnp left-pad @types/left-pad
echo '{"compilerOptions": {"baseUrl": ".", "strict": true, "esModuleInterop": true}}' > tsconfig.json
Expand Down

0 comments on commit 4499649

Please sign in to comment.