Skip to content

Init beta ​

The init command helps you initialize a new testbeats configuration file in your project. It creates a .testbeats.json file with default settings that you can customize, avoiding configuration errors for starters or during initial setup.

Usage ​

bash
npx testbeats@latest init

Options ​

OptionDescription
-v, --versionDisplay version of testbeats
-h, --helpDisplay help information
-l, --logLevelSets log level

Examples ​

Basic initialization:

bash
npx testbeats@latest init

testbeats-init-cli

Generated Config Structure ​

The command will generate a .testbeats.json file (can be customised) based on the options selected. Refer configuration for more details on configuration file fields to customise the configuration file.

Instructions ​

  1. After running npx testbeats@latest init successfully, you'll find a .testbeats.json or customised named file in your project directory where the init command was run.
  2. [Optional] Customize required sections based to add any additional configuration.
  3. Add your secret vars (webhooks, tokens, etc.) as needed to the environment/CI as required.
  4. Run npx testbeats@latest publish to publish.

NOTES

  • For security reasons, DO NOT harcode any sensitive information (webhook URLs, tokens, api-keys etc) in the configuration file, which you might accidentally commit to remote repository. Always use ENV vars or Secrets Vars in the environment.

See Also ​

  • Publish - Learn how to publish test results using your generated configuration.

Released under the MIT License.