node.js - 在 Windows 上通过 Github Actions 使用 Jest 时,日志中没有失败原因
问题描述
我正在尝试设置 Github Actions 以使用 Jest 运行我们的测试。问题是,当 Windows 上的测试失败时,我的操作日志中没有任何错误。
这是我的.github/workflows/CI.yml
:
name: CI
on: [push, pull_request]
jobs:
Tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [10]
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- run: git config --global core.autocrlf false
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm i -g yarn
- name: yarn install and test
run: |
yarn config set ignore-engines true
yarn
yarn test --verbose=false
Format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- run: npm i -g yarn
- name: yarn install and format
run: |
yarn config set ignore-engines true
yarn
yarn format:prettier
yarn test
运行jest tests
。_
此操作在 Windows 上输出以下内容:
yarn config set ignore-engines true
yarn
yarn test --verbose=false
shell: C:\Program Files\PowerShell\6\pwsh.EXE -command ". '{0}'"
yarn config v1.22.0
success Set "ignore-engines" to "true".
Done in 0.06s.
yarn install v1.22.0
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@2.1.2: The platform "win32" is incompatible with this module.
info "fsevents@2.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
Done in 43.23s.
yarn run v1.22.0
$ jest tests --verbose=false
FAIL tests/end-to-end.test.ts
##[error]Process completed with exit code 1.
我尝试过使用和不使用--verbose
标志,但都输出:
FAIL tests/end-to-end.test.ts
##[error]Process completed with exit code 1.
仅此而已。甚至没有通过测试。我不知道这可能来自哪里。
此外,这仅在 Windows 上附加。在 Ubuntu 和 Mac 上,Jest 有正确的输出(成功的测试以及失败的原因)。
解决方案
推荐阅读
- wordpress - 带有 WordPress 的 Botframework
- angular - 单击按钮时在 ngFor 列表中输入操作
- r - data.table r 中按组的慢速函数
- java - 使用 JSP 从数据库中删除行
- python - 打印 Pandas 列名而不是整个 DataFrame
- hardware - WebAssembly 的硬件实现
- c# - 查看未重定向到 IIS 服务器上设置的端口的操作
- graphics - 在 3D 体素空间中绘制通过 3D 线的所有体素
- regex - 正则表达式别名以匹配任何路由
- laravel - Laravel:如何在集合中使用 GroupBy