Outils pour utilisateurs

Outils du site


web:javascript:angular:unittests

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
web:javascript:angular:unittests [2019/06/11 02:56] – [Integration Testing of Services] sgariepyweb:javascript:angular:unittests [2022/02/02 00:42] (Version actuelle) – modification externe 127.0.0.1
Ligne 650: Ligne 650:
 </code> </code>
  
 +==== Obtenir l'instance de service ====
  
  
 +Pour obtenir une instance de ''service'', on peut faire:
 +
 +<code javascript>
 +import { TestBed, inject } from '@angular/core/testing';
 +
 +// ...
 +
 +it('should call get with the correct URL', inject([HeroService], (service: HeroService) => {
 +  // ...
 +}));
 +</code>
 +
 +
 +----
 +
 +
 +====== Testing DOM Interaction and Routing Components ======
 +
 +
 +
 +
 +
 +====== Sources ======
 +
 +  * [[https://medium.com/ngconf/mockstore-in-ngrx-v7-0-f7803708de4e|MockStore in NgRx v7.0]]
  
  
  
web/javascript/angular/unittests.1560214611.txt.gz · Dernière modification : 2022/02/02 00:43 (modification externe)