NativeScript / NativeScript/nativescript-cli
test init messes up project
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- JavaScript
- Sterne
- 1.1k
- Forks
- 204
- Ø Merge
- 1 T. 9 Std.
- Gemergte PRs (30 T.)
- 8
Beschreibung
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
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Reproduziere den Fehler mit tns create demo-test --tsc, tns test init und tns test ios, und untersuche den vom CLI gemeldeten CLI-Pfad in lib/common/mobile/mobile-core/devices-service.js. Verfolge, wie die Einrichtung des Mocha-Tests initialisiert wird, und bestimme, was geändert werden muss, damit das generierte TypeScript-Projekt seine iOS-Tests ohne den Importfehler ausführt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript
- Bereich
- cli, testing
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 48/100