【发布时间】:2019-02-28 15:50:19
【问题描述】:
我不确定我是否正确构建了问题标题。我想使用 ng test 为我的 Angular 7 应用程序运行测试。在我的一个组件中,我使用了 Stylus 样式表:
@Component({
selector: 'app-root',
template: ``,
encapsulation: ViewEncapsulation.None,
styleUrls: ['../../../../src/app/globalNg1Styles.styl']
})
当我为应用程序提供服务时它工作正常,但当我尝试运行测试时出现此错误:
ERROR in (...)/src/app/globalNg1Styles.styl
Module build failed (from (...)node_modules/stylus-loader/index.js):
TypeError: Cannot read property 'stylus' of undefined at Object.module.exports ((...)node_modules/stylus-loader/index.js:29:33)
@ ./src/app/catalog.component.ts 18:21-72
@ ./src/app/catalog.component.spec.ts
@ ./src sync \.spec\.ts$
@ ./src/test.ts
我不明白出了什么问题,我该如何解决问题。
【问题讨论】:
标签: javascript angular testing karma-runner stylus