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 摘要。