NativeScript / NativeScript/nativescript-cli

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

Offen
#2,095 5 Kommentare 6 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

feature unit testing
Vorherrschende Sprache
JavaScript
Sterne
1.1k
Forks
204
Ø Merge
1 T. 9 Std.
Gemergte PRs (30 T.)
8

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, nachzuvollziehen, wie die CLI derzeit Testdateien unter app/tests findet und verarbeitet, einschließlich des Verhaltens im Watch-Modus. Vergleiche diesen Ablauf mit den angeforderten .spec.ts-Dateien in Feature-Ordnern und bestimme das erwartete Verhalten für gemeinsame Tests; die Aufgabe ist abgeschlossen, wenn feature-lokale Tests ohne manuelles Kopieren unterstützt werden.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
angular, typescript
Bereich
cli, testing
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.