Skip to content
  • There are no suggestions because the search field is empty.

.cbconfig file

Allow running unit tests separately or modify the main run commands

Overriding run and compile commands

When creating a custom challenge or interview question, certain languages load with a .cbconfig file that contains a compile and/or a run command. You are able to override these depending on your challenge requirements. 

For example, in TypeScript if you want to run Playwright tests you can change the run command to the following: 

{
  "run": "npx playwright test"
}

Custom unit tests button

While you're able to create a custom unit testing challenge, you may want to provide candidates the option to run arbitrary code along with running a test case suite as separate options.

In your .cbconfig you're able to provide a custom unit tests entry file. The contents should be a JSON object like the following:

{
  "unitTests": {
    "label": "Run Unit Tests",
    "entry": "run_tests.py"
  }
}

This will then load a button with your text to the top-right of the IDE.