Skip to main content
Version: 9.0.0

Initialize a Test Maker Project

Initialize a Test Maker project with the following command:

npx ketm init [OPTIONS...]

Options include:

  • None at the moment. Use npx ketm init --help for any future updates.

The npx ketm init command presents several options for initializing a Test Maker project. Here's a breakdown of each generation method:

Init Express

Init-Express

This option generates a default convention Test Maker project structure suitable for any applications. It sets up the necessary directories and files to start writing tests.

When initializing a Test Maker project using the npx ketm init command with the Init Express option, the following actions are performed:

  1. NPM test:local script: A script for running tests locally is generated and configured in the package.json file.

  2. NPM test:ci script: A script for running continuous integration tests is generated and configured in the package.json file.

  3. Test Maker Local Configuration File: A Test Maker configuration file (test-maker.local.ts) is generated. This file contains configurations specific to running tests locally.

  4. Test Maker CI Configuration File: Another Test Maker configuration file (test-maker.ci.ts) is generated. This file contains configurations specific to running tests in a continuous integration environment.

  5. tsconfig.json: A TypeScript configuration file (tsconfig.json) is generated. This file provides configuration settings for TypeScript projects.

  6. Example Test Specification: An example test specification file (example-spec.ts) is generated under the src/specs directory. This file serves as a template for writing test specifications using Test Maker syntax.

Init-Express-Gen

The Test Maker project is now initialized with a basic project structure and configuration files, allowing you to start writing and running tests for your Express.js application.

Custom

Choosing the "Custom" option during initialization allows you to tailor the generation process according to your specific project requirements. It provides flexibility in selecting individual components or features to include in your Test Maker project. Here's how the process works:

Init-Custom

  1. Choose Your Generation Method: After running the npx ketm init command, select the "Custom" option from the list of available generation methods.

  2. Select Components to Generate: You'll be presented with a list of components or features that you can include in your project. These may include:

    • TypeScript Configuration (tsconfig.json)
    • Spec Folder and Example Spec File
    • NPM run test:local Script
    • NPM run test:ci Script
    • Test Maker Local Configuration File (test-maker.local.ts)
    • Test Maker CI Configuration File (test-maker.ci.ts)
  3. Navigate and Select Files: To select a file, use the arrow keys to navigate to the desired file in the list of available options. Press the space key to select the file you want to include in your project. You'll notice that the circle next to the file is filled when selected.

  4. Confirm Selection: After selecting the desired files, press the Enter key to confirm your selection.

Init-Custom-Example

If you decide not to select any files and press Enter, you'll see a message indicating that no items were selected. This allows you to proceed without including any additional files in your project structure.

Choose the components you need based on your project requirements and preferences.

Install PEGA library only

This option installs the PEGA library only without generating any project structure. It's useful if you only need to install the PEGA library for your existing Test Maker project.

Pega-Library

You should see a confirmation message and pega-model added inside your package.json file.

Pega-Library-Mess

Init PEGA Express

Choosing the "Init PEGA Express" option generates a default convention Test Maker/PEGA project structure specifically tailored for Express.js applications with PEGA integration. It sets up directories and files required for testing Express.js applications with PEGA features integrated.

Pega-Express

After selecting the "PEGA Express" generation method, the following actions are performed:

  1. README.md: A README file (README.md) is generated, providing instructions and information about the initialized project. This file serves as documentation for the project structure and customization options.

  2. Source Directory: A source directory (src) is generated, where the application source code and test files will be stored.

  3. Test Maker CI Configuration File: A Test Maker CI configuration file (test-maker.ci.ts) is generated. This file contains configurations specific to running tests in a continuous integration environment with PEGA integration.

  4. Test Maker Local Configuration File: A Test Maker local configuration file (test-maker.local.ts) is generated. This file contains configurations specific to running tests locally with PEGA integration.

  5. Test Maker PEGA Configuration File: Another Test Maker configuration file (test-maker.pega.ts) is generated. This file contains configurations specific to PEGA integration.

  6. tsconfig.json: A TypeScript configuration file (tsconfig.json) is generated. This file provides configuration settings for TypeScript projects.

  7. NPM run test:local Script: A script for running tests locally (test:local) is generated and configured in the package.json file.

  8. NPM run test:ci Script: A script for running continuous integration tests (test:ci) is generated and configured in the package.json file.

  9. PEGA Model Installation: The PEGA Model is installed as a dependency for the project.

Pega-Express-Result

After initialization, the project is ready for further customization and development. Users are encouraged to review the generated README file (README.md) for additional information and instructions on customizing the project according to their requirements.