Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

514
Visualizações
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 Respostas
Responde à pergunta

0

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

const { expect, test } = require('@jest/globals');
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda