NativeScript / NativeScript/nativescript-cli

Testing broken: webpack 4 vs webpack 3 requirement by karma-webpack 3.0.5

Aperta
#5,472 2 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

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

Descrizione

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):

✔ Component nativescript has 7.1.2 version and is up to date.
✔ Component @nativescript/core has 7.1.2 version and is up to date.
✖ Component @nativescript/ios is not installed.
✔ Component @nativescript/android has 7.0.1 version and is up to date

Describe the bug

ns test android fails with this karma error:
ERROR [preprocess]: Can not load "webpack"!
Because webpack 3 can't be installed side by side with webpack 4 (afaik?!). npm install correctly states that the peer dependency for webpack 3 (required by karma-webpack@3.0.5) needs to be installed manually.

  "dependencies": {
    "@nativescript/core": "~7.1.0",
    "@nativescript/theme": "~2.3.0",
    "@nativescript/unit-test-runner": "^1.0.2"
  },
  "devDependencies": {
    "@nativescript/android": "7.0.1",
    "@nativescript/webpack": "~4.0.0",
    "@types/karma-chai": "0.1.2",
    "@types/mocha": "8.2.0",
    "chai": "4.2.0",
    "karma": "6.0.0",
    "karma-chai": "0.1.0",
    "karma-mocha": "2.0.1",
    "karma-nativescript-launcher": "0.4.0",
    "karma-webpack": "3.0.5",
    "mocha": "8.2.1",
    "typescript": "~3.9.0"
  },

To Reproduce

ns create karmaissue --template @nativescript/template-blank-ts@7.0.4
cd karmaissue
ns test init --framework mocha
ns test android

Expected behavior
Sample test runs (karma doesn't throw an error)

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 riproducendo il problema con i comandi elencati ns create, ns test init --framework mocha e ns test android. Esamina i requisiti di karma-webpack 3.0.5 e @nativescript/webpack 4.0.0; il lavoro è completato quando il test di esempio viene eseguito senza l'errore di pre-elaborazione di webpack.

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

Valutazione

Stack tecnologico
javascript, webpack
Ambito
cli, testing-qa
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.