Skip to content

add e2e tests

add e2e tests #73

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
jobs:
build-package:
name: Build Package
runs-on: ubuntu-latest
outputs:
package: ${{ steps.publish-local-package.outputs.package }}
steps:
- uses: tatethurston/github-actions/publish-local-package@main
id: publish-local-package
with:
path: packages/eslint-plugin-react-prefer-function-component
ci:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: tatethurston/github-actions/build@main
- run: pnpm lint
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: tatethurston/github-actions/build@main
- run: pnpm test:ci
- uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
e2e-legacy-config:
name: E2E Legacy Config
runs-on: ubuntu-latest
steps:
- uses: tatethurston/github-actions/build@main
- name: pnpm eslint
run: |
cd packages/legacy-config
output="tate" # $(pnpm eslint index.jsx)
echo "$output"
expected="Class component should be written as a function react-prefer-function-component/react-prefer-function-component"
if [[ "$output" != *"$expected"* ]]; then
echo "❌ Fail"
else
echo "✅ Pass"
fi
e2e-flat-config:
name: E2E Flat Config
runs-on: ubuntu-latest
steps:
- uses: tatethurston/github-actions/build@main
- name: pnpm eslint
run: |
cd packages/flat-config
output="tate" #$(pnpm eslint index.jsx)
echo "$output"
expected="Class component should be written as a function react-prefer-function-component/react-prefer-function-component"
if [[ "$output" != *"$expected"* ]]; then
echo "❌ Fail"
# exit 1
else
echo "✅ Pass"
fi