我想在我的angular 6应用程序中包含google closure library。我已经申请
npm install google-closure-compiler
和npm install google-closure-library
。
该应用可以编译并运行。但是,当我尝试运行用ng test
编写的测试时,它会显示错误消息:
ERROR in ./node_modules/google-closure-library/closure/goog/boostrap/nodejs.js
Module not found: Error: Can't resolve 'fs' in './node_modules/google-closure-library/closure/goog/bootstrap'
ERROR in ./node_modules/google-closure-library/closure/goog/promise/testsuiteadapter.js
Module not found: Error: Can't resolve 'promises_aplus_tests' in './node_modules/google-closure-library/closure/goog/promise/testsuiteadapter.js'
我使用有角度的官方demo示例,我刚刚添加了测试并安装了这两个库。我的猜测是我需要配置karma.conf.js
,但是我不知道该怎么做,有人知道如何解决吗?
答案 0 :(得分:1)