我不知道我是否把题目写对了。我想使用ng test对我的Range7应用程序进行测试。在我的组件中,我使用了一个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我不明白出了什么问题,怎么解决这个问题。
发布于 2019-03-01 07:56:53
触笔加载器版本(2.5.0)有错误。升级到3.0.2解决了这个问题。
https://stackoverflow.com/questions/54929511
复制相似问题