Skip to main content
Make your tests larger with dynamic data and secure secrets. Select the correct method for your test needs.

Environment Variables

Use environment variables for configuration that changes between environments (dev, staging, production). Also use them for secrets that you must not commit to the code. Use this method when you must run the same tests against different servers or with different credentials.

Test Fixtures

Test fixtures work best when you have structured, reusable test data that needs to be shared across multiple tests. Use fixtures when testing different user roles, product catalogs, or any scenario where you want to parameterize tests with a known set of data.
test/fixtures/users.js
test/permissions.test.js

Dynamic Data Generation

Dynamic data generation is perfect for creating unique test data on each run, avoiding conflicts with existing records, and testing edge cases with realistic data. Use libraries like Faker when you need fresh emails, names, or other data that won’t collide with previous test runs.