node.js - 用于 NodeJS 应用的 Azure Pipeline 中的 Karma 启动
问题描述
我有一个 NodeJS (FlexServices) 应用程序,我需要执行单元测试。
这是我的 karma.conf.js
module.exports = function(config) {
config.set({
frameworks: ["jasmine", "karma-typescript"],
files: [
{ pattern: "src/**/*.ts" }
],
preprocessors: {
"**/*.ts": ["karma-typescript"]
},
reporters: ["progress", "karma-typescript"],
browsers: ["Chrome"],
singleRun: true
});
};
我拥有的管道目前正在本地 Windows 服务器上运行。在我运行karma start --single-run
命令之前,我安装了 karma cli。
- task: Npm@1
displayName: "npm install karma cli"
inputs:
command: 'custom'
customCommand: 'install -g karma-cli'
当我运行我的管道时,我从 npm 收到以下错误日志。
npm ERR! errno 1
> test-flex@2.2.0 test E:\ADOAgents\Agent1\_work\3185\s
npm ERR! test-flex@2.2.0 test: `karma start --single-run`
> karma start --single-run
npm ERR! Exit status 1
npm ERR!
29 04 2021 10:35:45.388:INFO [compiler.karma-typescript]: Compiling project using Typescript 3.9.9
npm ERR! Failed at the test-flex@2.2.0 test script.
29 04 2021 10:35:50.633:INFO [compiler.karma-typescript]: Compiled 12 files in 5230 ms.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
29 04 2021 10:35:51.532:INFO [bundler.karma-typescript]: Bundled imports for 11 file(s) in 388 ms.
29 04 2021 10:35:51.977:INFO [karma-server]: Karma v4.4.1 server started at http://0.0.0.0:9876/
npm ERR! A complete log of this run can be found in:
29 04 2021 10:35:51.978:INFO [launcher]: Launching browsers Chrome with concurrency unlimited
npm ERR! C:\Users\svc-teamfbuild\AppData\Roaming\npm-cache\_logs\2021-04-29T14_36_56_065Z-debug.log
29 04 2021 10:35:51.988:INFO [launcher]: Starting browser Chrome
29 04 2021 10:36:52.006:WARN [launcher]: Chrome have not captured in 60000 ms, killing.
29 04 2021 10:36:54.015:WARN [launcher]: Chrome was not killed in 2000 ms, sending SIGKILL.
29 04 2021 10:36:56.018:WARN [launcher]: Chrome was not killed by SIGKILL in 2000 ms, continuing.
我错过了一些东西来让它工作吗?
解决方案
推荐阅读
- java - 如何创建一个检查每个 int 的 for 循环
- r - 将列附加到 data.table,排序并避免 setDT
- r - 堆积条形图ggplot2-按特定变量排序样本,从最高到最低值
- sql-server - SQL Server PowerShell 提供程序错误:无法连接
- sharepoint-online - Sharepoint 下载 .aspx 而不是呈现页面
- sql - 如何找到sql中每一行的中位数(Microsoft SQL)
- python - USACO 网站不接受 python 解决方案
- scikit-learn - 忽略多输出回归的未知目标
- c# - 异步/等待多个 CountAsync 数据库调用 EFCore
- r - R Studio 不会插入选项卡,而是显示“(不匹配)” - 如何修复?