Skip to content

Commit

Permalink
chore: adding cypress integration tests (#240)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Bannert <[email protected]>
Co-authored-by: Shinigami92 <[email protected]>
  • Loading branch information
3 people authored Jan 28, 2022
1 parent bba4741 commit 9786fdd
Show file tree
Hide file tree
Showing 6 changed files with 861 additions and 87 deletions.
22 changes: 20 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
pull_request:

jobs:
test:
unit-test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -20,7 +20,7 @@ jobs:
node_version: 16
fail-fast: false

name: 'Build & Test: node-${{ matrix.node_version }}, ${{ matrix.os }}'
name: 'Build & Unit Test: node-${{ matrix.node_version }}, ${{ matrix.os }}'
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -45,6 +45,24 @@ jobs:
- name: Test
run: pnpm run test

e2e-test:
runs-on: ubuntu-latest
name: 'E2E Doc Test: node-16, ubuntu-latest'
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 6

- name: Install deps
run: pnpm install

- name: Run E2E
run: pnpm run docs:build:ci

lint:
runs-on: ubuntu-latest
name: 'Lint: node-16, ubuntu-latest'
Expand Down
11 changes: 11 additions & 0 deletions cypress.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"video": false,
"e2e": {
"baseUrl": "http://localhost:5000",
"integrationFolder": "cypress/e2e",
"testFiles": "**/*.cy.*",
"pluginsFile": false,
"supportFile": false,
"fixturesFolder": false
}
}
11 changes: 11 additions & 0 deletions cypress/e2e/smoke.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
describe('Smoke Test', () => {
it('compiles the guide page', () => {
cy.visit('/guide/');
cy.contains('Getting Started');
});

// it('compiles the playground page', () => {
// cy.visit('/playground/');
// cy.contains('Playground under construction');
// });
});
8 changes: 8 additions & 0 deletions cypress/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"compilerOptions": {
"target": "ES5",
"lib": ["ES5", "DOM"],
"types": ["cypress"]
},
"include": ["**/*.ts"]
}
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@
"format": "prettier --write .",
"lint": "echo 'TODO eslint'",
"test": "vitest",
"coverage": "vitest run --coverage"
"coverage": "vitest run --coverage",
"cypress": "cypress",
"docs:test:e2e:ci": "run-s docs:build:ci docs:test:e2e:run",
"docs:test:e2e:run": "run-p --race docs:serve \"cypress run\"",
"docs:test:e2e:open": "run-p --race docs:serve \"cypress open\""
},
"simple-git-hooks": {
"pre-commit": "npx lint-staged --concurrent false",
Expand All @@ -85,6 +89,7 @@
"@vitest/ui": "~0.1.24",
"c8": "~7.11.0",
"conventional-changelog-cli": "~2.2.2",
"cypress": "~9.3.1",
"esbuild": "~0.14.13",
"eslint": "^6.5.1",
"esno": "~0.13.0",
Expand Down
Loading

0 comments on commit 9786fdd

Please sign in to comment.