NPM packages
Not all NPM packages from NPM are available inside the context of a Check.
runtimeId
.
This can be configured at the check and group level using constructs, and a default value for the project can be set in the project configuration file.
A runtime contains among others:
- Nodejs v22+
@playwright/test 1.51.1
axios 0.28.0
lodash 4.17.21
moment 2.30.1
Local Dependencies
Your checks are also able to import other JavaScript and TypeScript files as dependencies. This is useful for defining helper functions to be reused across multiple checks. The Checkly CLI will automatically detect these dependencies and make sure that they’re bundled as part of the check. No additional configuration is needed. Here is a Browser Check example of how this works in practice. The directory tree looks like the following:login-helper.ts
defines a function gitHubLogin
that can be used by multiple Browser Checks.
login-helper.ts
login.spec.ts
we define the actual Playwright test. This file can import the gitHubLogin
function from login-helper.ts
.
It also reads the username and password from remote environment variables.
login.spec.ts
login.check.ts
initializes a new BrowserCheck construct. Note that it’s only necessary to configure the main Playwright file login.spec.ts
. The login-helper.ts
dependency is automatically detected by the CLI.
login.check.ts
npx checkly deploy
, you can see in the Web UI that the helper file login-helper.ts
was also uploaded for this Check.
