Skip to content

Commit

Permalink
Update ng-mocks.md
Browse files Browse the repository at this point in the history
remove the highlighting of two lines from the last test example and update the text below
  • Loading branch information
GanjaGanja authored Oct 4, 2023
1 parent 37aac10 commit f60bedf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions data/blog/ng-mocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ As you can see, now it's a bit less code in the tests.

One more exciting thing from NG-Mocks is a proposal on [how to make tests more maintainable](https://ng-mocks.sudo.eu/extra/how-to-write-tests). The idea is to write tests without scoped variables. Basically, specific arrangements need to be applied to specific tests so that each test is self-sufficient and does not rely on scoped variables:

```typescript:auth.service.spec.ts {5,11, 16-17, 26-28}
```typescript:auth.service.spec.ts {16-17, 26-28}
ngMocks.autoSpy('jasmine');

describe('AuthService', () => {
Expand Down Expand Up @@ -260,7 +260,7 @@ describe('AuthService', () => {
});
```

Unit tests are updated and more maintainable.
As you can see now arrangements are applied to specific tests. That should make them more maintainable as we add other tests into that `.spec` file.

## Conclusion

Expand Down

0 comments on commit f60bedf

Please sign in to comment.