Closed ilife5 closed 10 years ago
karma.conf.js中files项提供server服务,描述如官网:
The files array determines which files are included in the browser and which files are watched and served by Karma.
对html文件需要注意,如果files中按照如下写法
files: [ "path/*.html" ]
此时在chrome中运行时将会把html文件执行,包括其中的scripts代码
可以参考官网对files的配置项:
对配置修改如下:
files: [{ "pattern": "test/*.html", "included": false }]
即可以在控制台中观察到该html文件只加载以及执行一遍。
karma.conf.js中files项提供server服务,描述如官网:
The files array determines which files are included in the browser and which files are watched and served by Karma.
对html文件需要注意,如果files中按照如下写法
此时在chrome中运行时将会把html文件执行,包括其中的scripts代码