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

513
Views
Jest Test suite failed to run

I am trying to add Jest tests to a vanilla JS project. I installed Jest with npm, and created an example test file:

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

const one = 1;

test("example test", () => {
  expect(one).toBe(1);
});

But I am getting the following 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.

Not sure what might be wrong? I clearly have a test/expect block in the test file. I also tried changing test to it but that had no effect.

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

0

You should import test function from @jest/globals package.

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!