Issues when testing with jest

Aperta
#2,140 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
javascript, nodejs, typescript

Direzione di ricerca

Inizia con l’esempio collegato Saulzi/nodejsissues: ripristina i relativi pacchetti ed esegui i test con npx jest. Esamina package.json, node_modules, JavascriptTestRoot e il percorso indicato source/cool.test.js mentre riproduci i sei problemi di individuazione e configurazione. Il lavoro è completo quando i casi segnalati di individuazione dei test Jest e TypeScript hanno un comportamento chiaro e verificato.

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

Descrizione

Issues

@armanio123 as discussed at https://github.com/MicrosoftDocs/visualstudio-docs/issues/1989 you can find example code at.
https://github.com/Saulzi/nodejsissues.git

you will need to restore packages etc, standard stuff.
all tests run in jest by running test with npx jest

Issue 1.
Not all tests are discovered, (because of how node-editor-support) detects tests, likewise detected tests are not correctly displayed in test hierarchy.

Issue 2.
when package.json and node_modules are in folder pointed to in JavascriptTestRoot, no tests are discovered.

[07/03/2019 10:31:20 Error] Failed to find "jest" package. "jest" must be installed in the project locally.
[07/03/2019 10:31:20 Error] Install "jest" locally using the npm manager via solution explorer
[07/03/2019 10:31:20 Error] or with ".npm install jest --save-dev" via the Node.js interactive window.

Issue 3 - think this one is already documented at (https://docs.microsoft.com/en-us/visualstudio/javascript/unit-testing-javascript-with-visual-studio?view=vs-2017), .net core projects dont work at all.

Issue 4 - typescript built using outdir does not get detected.
[07/03/2019 10:52:08 Informational] Processing: C:\Users\t.salisbury\Desktop\TestingIssues\Issues\Issue 4\source\cool.test.js
[07/03/2019 10:52:12 Error] Test discovery error: { Error: ENOENT: no such file or directory, open 'C:\Users\t.salisbury\Desktop\TestingIssues\Issues\Issue 4\source\cool.test.js'
[07/03/2019 10:52:12 Error] at Object.openSync (fs.js:439:3)

Issue 5 - does not like noemit / jest using babel

Issue 6 - does not ignore tests in node_modules

Lingua principale
C#
Stelle
1.8k
Fork
355
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

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.

Altre issue di microsoft/nodejstools

Tutte le issue di microsoft/nodejstools

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.