Ceci est ma fonction dans le fichier ts.angular - ReferenceError: Impossible de trouver la variable: URLSearchParams dans http: // localhost: 9877src/test.ts
getFeatures() {
const queryString = new URLSearchParams();
...
}
Ceci est mon fichier de jasmin.
it('should get features', inject([FeatureSupportService], (service : FeatureSupportService) => {
expect(service.getFeatures()).toBeTruthy();
}));
Erreur: Je ne reçois pas cette erreur dans le karma mais je reçois cette erreur lorsque je tente de couverture de code avec yarn test
Can't find variable: URLSearchParams in http://localhost:9877src/test.ts
c'est la bonne réponse, au moins en général! J'utilise généralement Chrome et non PhantomJS, donc quand je suis passé à Phantom, j'ai commencé à voir ces erreurs apparaître. Quand j'ai changé, ils ont disparu. –