test init messes up project

オープン
#5,396 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
javascript
領域
cli, testing

調査の方向性

tns create demo-test --tsctns test inittns test ios で失敗を再現し、その後 lib/common/mobile/mobile-core/devices-service.js に報告されている CLI パスを調べます。Mocha テストのセットアップがどのように初期化されるかを追跡し、生成された TypeScript プロジェクトが import エラーなしで iOS テストを実行できるようにするには何を変更する必要があるかを特定します。

索引モデルが issue の本文から書いたものです。

説明

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):
✔ Getting NativeScript components versions information...
✔ Component nativescript has 7.0.8 version and is up to date.
✔ Component @nativescript/core has 7.0.3 version and is up to date.
✔ Component @nativescript/ios has 7.0.0 version and is up to date.
✖ Component @nativescript/android is not installed.

Describe the bug
Trying to run unit tests fails with the following error:

Error: Cannot use import statement outside a module
    at Errors.failWithOptions (/usr/local/lib/node_modules/nativescript/lib/common/errors.js:157:27)
    at Errors.fail (/usr/local/lib/node_modules/nativescript/lib/common/errors.js:130:21)
    at DevicesService.<anonymous> (/usr/local/lib/node_modules/nativescript/lib/common/mobile/mobile-core/devices-service.js:425:30)
    at Generator.throw (<anonymous>)
    at rejected (/usr/local/lib/node_modules/nativescript/lib/common/mobile/mobile-core/devices-service.js:12:65)
    at processTicksAndRejections (internal/process/task_queues.js:97:5) {
  name: 'Exception',
  errorCode: 127,
  suggestCommandHelp: false,
  proxyAuthenticationRequired: false,
  printOnStdout: undefined
}

To Reproduce

tns create demo-test --tsc
tns test init #select mocha
tns test ios

Expected behavior
Tests to run.

Sample project

Additional context

主要言語
JavaScript
スター
1.1k
フォーク
204
平均マージ
1日 9時間
マージ済み PR(30日)
8

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

NativeScript/nativescript-cli のほかの issue

NativeScript/nativescript-cli の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。