Skip to content

Commit

Permalink
test(e2e): adjust ts-node-import-error snapshot (#230)
Browse files Browse the repository at this point in the history
  • Loading branch information
boostvolt authored Aug 25, 2022
1 parent fccffd5 commit e464f2f
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 41 deletions.
107 changes: 67 additions & 40 deletions .github/workflows/pr.yml → .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,79 +1,106 @@
name: pr

name: Pull Request
on:
- pull_request
pull_request:

jobs:
prettier:
validate:
name: Validate Codebase
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Install Dependencies
run: yarn --frozen-lockfile
- run: yarn -s format:check

eslint:
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
matrix:
node-version: [14]

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- name: Checkout repository
uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: 14.x
- name: Install Dependencies
node-version: ${{ matrix.node-version }}
cache: 'yarn'

- name: Install dependencies
run: yarn --frozen-lockfile
- run: yarn -s lint:check

- name: Run prettier
run: yarn -s format:check

- name: Run es-lint
run: yarn -s lint:check

test-latest-prisma:
needs: [validate]
name: Test with latest Prisma
timeout-minutes: 20

strategy:
matrix:
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
node-version: [14.x, 16.x]
node-version: [14, 16]

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Checkout repository
uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: yarn --frozen-lockfile
- name: Set E2E DB Schema
run: yarn -s ts-node scripts/get-e2e-db-schema --os ${{ matrix.os }} --node-version ${{ matrix.node-version }} --github-env $env:GITHUB_ENV
cache: 'yarn'

- name: Install dependencies
run: yarn --frozen-lockfile

- name: Set E2E DB Schema for Windows
if: ${{ matrix.os == 'windows-latest' }}
- name: Set E2E DB Schema
run: yarn -s ts-node scripts/get-e2e-db-schema --os ${{ matrix.os }} --node-version ${{ matrix.node-version }} --github-env $GITHUB_ENV
run: yarn -s ts-node scripts/get-e2e-db-schema --os ${{ matrix.os }} --node-version ${{ matrix.node-version }} --github-env $env:GITHUB_ENV

- name: Set E2E DB Schema for other operating systems
if: ${{ matrix.os != 'windows-latest' }}
- run: yarn -s build
- run: yarn -s test:ci
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '16.x'
with:
directory: ./coverage
run: yarn -s ts-node scripts/get-e2e-db-schema --os ${{ matrix.os }} --node-version ${{ matrix.node-version }} --github-env $GITHUB_ENV

- name: Build
run: yarn -s build

- name: Test
run: yarn -s test:ci

test-past-prisma:
needs: [validate]
name: Test with past Prisma
timeout-minutes: 20

strategy:
matrix:
os: ['ubuntu-latest']
node-version: [16.x]
node-version: [16]
prisma-client-version: ['4.0']

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Checkout repository
uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'

- run: yarn --frozen-lockfile

- name: Set E2E DB Schema
run: yarn -s ts-node scripts/get-e2e-db-schema --os ${{ matrix.os }} --node-version ${{ matrix.node-version }} --prisma-client-version ${{ matrix.prisma-client-version }} --github-env $GITHUB_ENV
- run: yarn -s build

- name: Build
run: yarn -s build

- name: Install Prisma Client version
run: yarn -s add @prisma/client@${{ matrix.prisma-client-version }}
- run: yarn -s test:ci

- name: Test
run: yarn -s test:ci
2 changes: 1 addition & 1 deletion tests/e2e/__snapshots__/ts-node-import-error.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ exports[`when project does not have ts-node installed nexus-prisma generator sti
"Error:
✔ Generated Prisma Client (<SOME VERSION>) to <SOME PATH> in <SOME TIME><unit>
Error: Cannot find module 'ts-node'
Cannot find module 'ts-node'
Require stack:
- <SOME STACK>
Expand Down

1 comment on commit e464f2f

@vercel
Copy link

@vercel vercel bot commented on e464f2f Aug 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.