add module alias '@tests/'

Alias would remove unnecessary repetitions and less relative paths make changes easier when moving around files. This commit cleans also up some relative paths ('../../../') by using the alias and orders imports. It updates both path alias in tsconfig and module alias in Vue CLI's bundler (vuejs/vue-cli#2398).
This commit is contained in:
undergroundwires
2021-04-15 18:33:15 +02:00
parent b1ed3ce55f
commit 60c80611ea
62 changed files with 161 additions and 149 deletions

View File

@@ -1,16 +1,20 @@
# Unit tests
# Tests
- 💡 You can use path/module alias `@/tests` in import statements.
## Unit tests
- Unit tests are defined in [`./tests`](./../tests)
- They follow same folder structure as [`./src`](./../src)
## Naming
### Naming
- Each test suite first describe the system under test
- E.g. tests for class `Application` is categorized under `Application`
- Tests for specific methods are categorized under method name (if applicable)
- E.g. test for `run()` is categorized under `run`
## Act, arrange, assert
### Act, arrange, assert
- Tests use act, arrange and assert (AAA) pattern when applicable
- **Arrange**
@@ -23,7 +27,7 @@
- Should elicit some sort of response
- Starts with comment line `// assert`
## Stubs
### Stubs
- Stubs are defined in [`./tests/stubs`](./../tests/unit/stubs)
- They implement dummy behavior to be functional