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

144
Views
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 answers
Answer question

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 Report

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 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!