Skip to content

Commit

Permalink
add initial integration tests
Browse files Browse the repository at this point in the history
Integration tests are executed using vue-cli-service with double quotes as following: `vue-cli-service test:unit "tests/integration/**/*.spec.ts"`. Using single quotes (mochajs/mocha#1828) works on macOS and Ubuntu but does not on Windows (tests are not found). Double quotes is the only portable way that works on all three platforms (mochajs/mocha#3136).
  • Loading branch information
undergroundwires committed May 3, 2021
1 parent 38f73bc commit 131a984
Show file tree
Hide file tree
Showing 9 changed files with 20,609 additions and 34 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/deploy-desktop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ jobs:
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm run test:unit
run: |
npm run test:unit
npm run test:integration
- name: Publish desktop app
run: npm run electron:build -- -p always # https://nklayman.github.io/vue-cli-plugin-electron-builder/guide/recipes.html#upload-release-to-github
env:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/deploy-site.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ jobs:
working-directory: site
-
name: "App: Run tests"
run: npm run test:unit
run: |
npm run test:unit
npm run test:integration
working-directory: site
-
name: "App: Build"
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,8 @@ jobs:
name: Install dependencies
run: npm ci
-
name: Run tests
name: Run unit tests
run: npm run test:unit
-
name: Run integration tests
run: npm run test:integration
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
- Project setup: `npm install`
- Testing
- Run unit tests: `npm run test:unit`
- Run integration tests: `npm run test:integration`
- Lint: `npm run lint`
- **Desktop app**
- Development: `npm run electron:serve`
Expand Down
12 changes: 11 additions & 1 deletion docs/tests.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# Tests

- There are two different types of tests executed:
1. [Unit tests](#unit-tests)
2. [Integration tests](#integration-tests)
- 💡 You can use path/module alias `@/tests` in import statements.

## Unit tests

- Unit tests are defined in [`./tests`](./../tests)
- Tests each component in isolation
- Defined in [`./tests/unit`](./../tests/unit)
- They follow same folder structure as [`./src`](./../src)

### Naming
Expand All @@ -31,3 +35,9 @@

- Stubs are defined in [`./tests/stubs`](./../tests/unit/stubs)
- They implement dummy behavior to be functional

## Integration tests

- Tests functionality of a component in combination with others (not isolated)
- Ensure dependencies to third parties work as expected
- Defined in [`./tests/integration`](./../tests/integration)
Loading

0 comments on commit 131a984

Please sign in to comment.