NativeScript / NativeScript/nativescript-cli
test init messes up project
Ninguém assumiu esta issue ainda.
- Linguagem predominante
- JavaScript
- Estrelas
- 1.1k
- Forks
- 204
- Merge médio
- 1d 9h
- PRs com merge (30d)
- 8
Descrição
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
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Direção de pesquisa
Reproduza a falha com tns create demo-test --tsc, tns test init e tns test ios e, em seguida, inspecione o caminho da CLI relatado em lib/common/mobile/mobile-core/devices-service.js. Rastreie como a configuração dos testes do Mocha é inicializada e determine o que precisa mudar para que o projeto TypeScript gerado execute seus testes do iOS sem o erro de importação.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- javascript
- Domínio
- cli, testing
- Tipo de issue
- Bug
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 48/100