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

156
Visualizações
How to organize codeception tests in subfolders, and have one codecept.conf.js pointing to the whole folder schema

I'm having issues, creating subfolders in my './acceptance_tests.js/*_tests.js' pathname within my codecept config.

I.e. My codecept.conf.js looks like this:

  exports.config = {
  tests: './acceptance_tests/*_test.js',
  output: './output' ....

I can run tests no problem that are within acceptance_test file path when the conf.js file is set to this. When I try to create a sub-folder to organize my tests i.e. acceptance_test > account_test > (tests) or acceptance_test > registration_test > (tests).

I am unable to call those tests, since the conf file is looking for all '*test.js' file within the acceptance_test folder.

I can change the path in the conf file to explicitly point to each subfolder, but it seems there must be a better way to do this. Since I would have to change the file path each time I wanted to run tests in another subfolder.

I have tried to point it to

'./acceptance_tests/randome_subfolder_Name/*_test.js'

'*_test.js'

'./acceptance_tests/*/*_test.js'

But cant seem to get it to run all subfolders or tests within those subfolders sitting within acceptance_test folder. I have tried manually calling out the whole path when running the test like so

Npm run codeceptjs  './acceptance_tests/random_subfolder_Name/andomTest_test.js'

And that doesn't work either. But the moment I take that test and drop it in the parent folder of acceptance_test - it does work.

Any help would be much appreciated.

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

you can run tests from any folder if you select config file manually, for example:

npx codeceptjs run --grep "test name" --config=tests/codecept.conf.js

in my case config file for all tests is located in the tests folder

about 4 years ago · Juan Pablo Isaza Relatório

0

In the config file you can specify it to look through subfolders with this

exports.config = {
tests: './acceptance_tests/**/*_test.js',
output: './output' ....

With the

'**' 

spanning through all subfolders under acceptance_tests

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