added testing part
This commit is contained in:
parent
46a84a5168
commit
c000b7ce0c
40
readme.md
40
readme.md
|
@ -220,6 +220,21 @@ public Image getImage(URL url, String name) {
|
|||
}
|
||||
```
|
||||
|
||||
## Testing
|
||||
|
||||
Junit will be used to perform tests as it is the most popular testing frameworks for java.
|
||||
|
||||
```java
|
||||
public class UserServiceTests {
|
||||
|
||||
@Test
|
||||
public void TestUserPermissions() {
|
||||
User user = new User();
|
||||
// testing done here
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
# Frontend
|
||||
|
||||
Documenting the frontend is quite hard, but since there will be state management and complicated classes for managing data it has to be all written down.
|
||||
|
@ -268,6 +283,31 @@ stateDiagram-v2
|
|||
Crash --> [*]
|
||||
```
|
||||
|
||||
## Testing
|
||||
|
||||
For testing typescript classes and it's methods [Jest](https://jestjs.io/docs/getting-started) (jestjs) will be used.
|
||||
|
||||
Example:
|
||||
|
||||
1. Define the test in `tests/test.ts`
|
||||
|
||||
```typescript
|
||||
// tests/testClass.ts
|
||||
function sum(a, b) {
|
||||
a + b;
|
||||
}
|
||||
|
||||
test("adds 1 + 2 to equal 3", () => {
|
||||
expect(sum(1, 2)).toBe(3);
|
||||
});
|
||||
```
|
||||
|
||||
2. Run test
|
||||
|
||||
```bash
|
||||
npm test
|
||||
```
|
||||
|
||||
# Development
|
||||
|
||||
## CI _Continuous Integration_
|
||||
|
|
Reference in a new issue