Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. class MyService {
  2.  
  3. protected otherService: OtherService;
  4.  
  5. constructor(os: OtherService) {
  6. this.otherService = ds;
  7. }
  8.  
  9. public someMethod() {
  10. this.otherService.doSomething();
  11. }
  12.  
  13. }
  14.  
  15. describe('Launcher Renderer', () => {
  16.  
  17. //dependencies (mocked)
  18. const os = sinon.mock(new OtherService());
  19.  
  20. // the renderer class
  21. let underTest: MyService;
  22.  
  23. before(() => {
  24. underTest = new MyService(os);
  25. });
  26.  
  27. // actual tests,....
  28. });
  29.  
  30. class MyService {
  31.  
  32. protected otherService: OtherService | any;
  33.  
  34. constructor(os: OtherService | any) {
  35. this.otherService = ds;
  36. }
  37.  
  38. public someMethod() {
  39. this.otherService.doSomething();
  40. }
  41.  
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement