gpt4 book ai didi

karma-runner - Karma 配置文件 - 使用 basePath

转载 作者:行者123 更新时间:2023-12-04 12:19:48 27 4
gpt4 key购买 nike

我只是在我的 Karma 配置文件中尝试一些东西,并且设置了一个文件数组,如下所示:

 files: [
'../dist/app/**/*.mock.js',
'../dist/assets/scripts/bower_libs.js',
'../dist/assets/scripts/main.js',
'../test/src/**/*.js',
'../dist/app/**/*.spec.js'
],

我知道我可以在这里使用 basePath,例如basePath: '../dist/' 在配置中,这将消除在其中一些路径上添加 '../dist/' 的需要。但是如果我的 test 文件夹与 dist 位于同一级别,我将如何提升级别?

会是这种事吗?
basePath: '../dist/'

files: [
'app/**/*.mock.js',
'assets/scripts/bower_libs.js',
'assets/scripts/main.js',
'../test/src/**/*.js',
'app/**/*.spec.js'
],

这可能是一个非常愚蠢的问题,但我只是想确定!

最佳答案

那应该是正确的。您可以指定一个相对路径以向上一个或多个目录。

从文档:

The root path location that will be used to resolve all relative paths defined in files and exclude. If the basePath configuration is a relative path then it will be resolved to the __dirname of the configuration file.



这是您可以尝试看看它是否有效的事情之一。

关于karma-runner - Karma 配置文件 - 使用 basePath,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31030903/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com