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

507
Views
El conjunto de pruebas Jest no se pudo ejecutar

Estoy tratando de agregar pruebas Jest a un proyecto Vanilla JS. Instalé Jest con npm y creé un archivo de prueba de ejemplo:

 // file example.test.js const { expect } = require("@jest/globals"); const { test } = require("jest-circus"); const one = 1; test("example test", () => { expect(one).toBe(1); });

Pero estoy recibiendo el siguiente error:

 FAIL ./example.test.js ● Test suite failed to run Your test suite must contain at least one test. at onResult (node_modules/@jest/core/build/TestScheduler.js:175:18) at Array.map (<anonymous>) Test Suites: 1 failed, 1 total Tests: 0 total Snapshots: 0 total Time: 0.437 s Ran all test suites.

¿No estás seguro de qué podría estar mal? Claramente tengo un bloque de prueba/espera en el archivo de prueba. También intenté cambiarle la test it pero eso no tuvo ningún efecto.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Debe importar la función de test del paquete @jest/globals .

 const { expect, test } = require('@jest/globals');
about 4 years ago · Juan Pablo Isaza Report
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!