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

279
Visualizações
How to execute jest tests in a particular folder

I want the script command below to have something like where it should run tests in that folder name

"scripts": {
    "test": "jest --testPathPattern==tests/<folder-name> --maxWorkers=2"
  },

to run tests in a particular folder.

This command is executed in a bash file run-tests.sh as shown below

#!/bin/bash
npm run test

is it possible to have something like

#!/bin/bash
npm run test <folder-name>  
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

According to the jest documentation you should be able to do this:

npm run test -- --testPathPattern==tests/<folder-name>

source: https://jestjs.io/docs/cli#using-with-npm-scripts

Alternatively something like this in your bash script should do the trick as well:

#!/bin/bash
pushd <directory here> # Basically cd into that directory
npm run test
popd # cd back into where we came from when we ran pushd

I think this will do what you are asking.

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