dimanche 28 février 2021

How can ng test cause dependency resolving errors?

While testing a component with ng test I ran into a cascade of errors similar to this

Error: ./node_modules/protractor/built/runner.js
Module not found: Error: Can't resolve 'child_process' in '/<path-to-project>/node_modules/protractor/built'
resolve 'child_process' in '/<path-to-project>/node_modules/protractor/built'
Parsed request is a module using description file: /<path-of-project>/node_modules/protractor/package.json (relative path: ./built)
Field 'browser' doesn't contain a valid alias configuration
resolve as module
<continued with other modules e.g. sauceLabs, selenium-webdriver>

The test is only testing if a part of the component is defined.

const card = element(By.tag('mat-card-content'))
expect(card).toBeDefined()

Aucun commentaire:

Enregistrer un commentaire