Add Jest coverage report information and two more tests

This commit is contained in:
James Skemp 2020-08-02 22:34:49 -05:00
parent 49850634e1
commit a0d16705e6
2 changed files with 18 additions and 0 deletions

View File

@ -33,6 +33,13 @@ npm run test
npm run test:coverage
```
For the coverage report:
- % Stmts = percent of statements called
- % Branch = percent of if/switch branches that have been checked
- % Funcs = percent of functions called
- % Lines = percent of lines covered
- Uncovered Line #s = exactly what it sounds like
#### Check for specific issues
```
npm run lint | grep require-returns

View File

@ -5,3 +5,14 @@ const world = new World();
test('World has empty journal', () => {
expect(world.journal.count()).toBe(0);
});
test('World journal has an entry', () => {
world.journal.addEntry(0, 'Test');
expect(world.journal.count()).toBe(1);
});
test('World journal is cleared', () => {
world.journal.addEntry(1, 'Test 2');
world.journal.erase();
expect(world.journal.count()).toBe(0);
});