NativeScript / NativeScript/nativescript-cli

Feature Request: Provision to put test files in feature folder instead of tests folder

Aperta
#2,095 5 commenti 6 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

feature unit testing
Lingua principale
JavaScript
Stelle
1.1k
Fork
204
Merge medio
1g 9h
PR unite (30g)
8

Descrizione

From @shripalsoni04 on September 30, 2016 15:2

It will be great if we can put our test files in the respective feature folder instead of putting all the test files in app/tests folder.

When we do development for web version of angular application, we put the test files in respective feature folders with .spec.ts suffix as per the angular style guide.

If we can do the same thing in angularNative app also, it will be very easy to get started and it will open a way for unit-test code sharing. As currently we have different structures for test files in nativescript and web version, we cannot share the unit-test files easily and we need to manually copy the unit-test files and change the import path of the module being tested in test file for any cross platform shared code.

I thought to run a script which copies all the .spec.ts file to tests folder from feature folders, but then it will add complexities like adding new/changed test files back to app/tests folder in watch mode.

Let me know if there is already some way and I am missing that.

Thanks.

Copied from original issue: NativeScript/nativescript-angular#482

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia individuando come la CLI scopre e gestisce attualmente i file di test in app/tests, incluso il comportamento in modalità watch. Confronta questo flusso con i file .spec.ts richiesti nelle cartelle delle funzionalità e determina il comportamento previsto per i test condivisi; il lavoro è completato quando i test locali delle funzionalità sono supportati senza copia manuale.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
angular, typescript
Ambito
cli, testing
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.