Cov txheej txheem:

Yuav ua li cas koj khiav ib qho kev sim ib zaug hauv karma?
Yuav ua li cas koj khiav ib qho kev sim ib zaug hauv karma?

Video: Yuav ua li cas koj khiav ib qho kev sim ib zaug hauv karma?

Video: Yuav ua li cas koj khiav ib qho kev sim ib zaug hauv karma?
Video: Khuv Xim Tsi Yuav Koj. Toj Vaj. Karaoke 2024, Hlis ntuj nqeg
Anonim

Los ntawm lub neej ntawd, karma khiav tag nrho koj xeem cov ntaub ntawv. Rau xeem a ib leeg cov ntaub ntawv lossis nplaub tshev, siv tus chij --grep. (Yog tias koj tau teeb tsa phau ntawv, xyuas kom koj lub config tuav tus chij no). Hla cov ntaub ntawv rau xeem rau grep chij: npm khiav xeem ------ grep xeem /foo/bar.

Raws li, ua li cas koj khiav cov ntaub ntawv xeem hauv karma?

Nco ntsoov tias koj yuav tau siv Karma nrog Windows los sim hauv Internet Explorer

  1. Kauj ruam 1: Installation. Nruab Karma thiab cov plugins tsim nyog siv NPM.
  2. Kauj ruam 2: Configuration. Tsim cov ntaub ntawv hu ua karma-conf.
  3. Kauj ruam 3: Khiav Kev Xeem Siv Karma Command Line Interface.

Ib sab saum toj no, kuv yuav ua li cas thiaj li khiav jasmine xeem los ntawm kab hais kom ua? Qhov no yuav ua rau koj mus sai sai:

  1. nruab Node. js (pom tseeb).
  2. Tom ntej no install Jasmine. Qhib cov lus hais kom ua thiab khiav: npm nruab -g jasmine.
  3. Tom ntej no, cd rau ib phau ntawv teev npe thiab teeb tsa ib qho piv txwv 'project': jasmine init. jasmine piv txwv.
  4. Tam sim no khiav koj qhov kev sim ntsuas: jasmine.

Yog li ntawd, dab tsi yog ib leeg khiav hauv karma?

CLI: -- ib leeg - khiav , --tsis- ib leeg - khiav . Nqe lus piav qhia: Kev sib koom ua ke tsis tu ncua. Yog muaj tseeb, Karma yuav pib thiab ntes tag nrho cov configured browsers, khiav kev sim thiab tom qab ntawd tawm nrog kev tawm ntawm 0 lossis 1 nyob ntawm seb txhua qhov kev xeem dhau los lossis ib qho kev xeem ua tsis tiav.

karma JavaScript yog dab tsi?

Karma yog xeem khiav rau JavaScript uas khiav ntawm Node. js. Siv Karma khiav kev xeem siv ib qho ntawm ntau yam nrov JavaScript kuaj suites (Jasmine, Mocha, QUnit, thiab lwm yam) thiab muaj cov kev sim no tsis tsuas yog nyob rau hauv browsers ntawm koj xaiv, tab sis kuj nyob rau hauv lub platform ntawm koj xaiv (desktop, xov tooj, ntsiav tshuaj.)

Pom zoo: