【发布时间】:2021-02-28 10:49:30
【问题描述】:
在使用 ng test 测试组件时,我遇到了级联
类似的错误
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>
测试只是测试组件的一部分是否被定义。
const card = element(By.tag('mat-card-content'))
expect(card).toBeDefined()
【问题讨论】: