NativeScript / NativeScript/nativescript-cli

`tns test init --framework qunit` fails on windows

未关闭
#4,333 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

bug os: windows unit testing
主要语言
JavaScript
星标
1.1k
派生
204
平均合并
1 天 9 小时
30 天内合并 PR
8

描述

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: latest
  • Cross-platform modules: latest
  • Android Runtime: latest
  • iOS Runtime: latest
  • Plugin(s): No

Describe the bug
tns test init --framework qunit fails on windows

To Reproduce

tns create TestApp
cd TestApp
tns test init --framework qunit

=> Fails with non zero exit code.

Expected behavior
tns test init to work properly.

Additional context
Looks to be caused by the fact that there is no qunit@2.0.0 version on npm and in karma-qunit package.json we have:

"peerDependencies": {
    "qunit": "^2.0.0"
  },

Workaround
Execute npm i qunit@2 --save-dev before tns test init.
Note that tns test init will still fail, but after that tns test will be fine.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先使用 tns create TestApp 运行报告中的 Windows 复现步骤,然后运行 tns test init --framework qunit;检查 CLI 如何解析和安装 QUnit 与 karma-qunit 依赖项。变通方案和 peer dependency 的详细信息表明,重点在于依赖项设置。完成的标准是:无需手动安装 qunit@2,初始化即可成功退出,并且后续测试命令能够正常运行。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript
领域
cli, testing-qa
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。