Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

228
Views
ReferenceError: la expectativa no está definida cuando se usa jasmine para hacer una prueba unitaria

Uso jasmine para hacer una prueba de unidad cuando escribo una biblioteca de javascript, sigo el documento oficial https://jasmine.github.io/tutorials/your_first_suite , el código demo.js ve así:

 'use strict'; describe("A suite", function() { it("contains spec with an expectation", function() { expect(true).toBe(true); }); });

cuando estoy usando este comando para ejecutar la prueba unitaria:

 istanbul cover _mocha ./test/demo.js

mostrar la salida del registro de esta manera:

 A suite 1) contains spec with an expectation 0 passing (6ms) 1 failing 1) A suite contains spec with an expectation: ReferenceError: expect is not defined at Context.<anonymous> (test/demo.js:7:7)

que debo hacer para evitar este problema? la versión del nodo es v10.24.1 . La información de jazmín:

  • jazmín v3.10.0
  • jazmín-núcleo v3.10.1

He intentado instalar jasmine-expect usando este comando:

 npm install jasmine-expect --save-dev

todavia no lo arreglo. Probé jazmín así:

 global.expect = require('jasmine-expect').expect;
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!