Node.js QuickStart Guide
Prerequisites
1. Update Project Files
1. Update package.json
{
"name": "my-awesome-app",
"version": "1.0.0",
// ... other properties
"dependencies": {
"@hypertestco/node-sdk": "0.2.28-96", // check the latest version from npm
// ... your other dependencies
},
"devDependencies": {
"@hypertestco/ht-cli": "0.2.28-96", // check the latest version from npm
"nyc": "^17.1.0",
// ... your other devDependencies
},
"scripts": {
"start": "node index.js", // <-- IMPORTANT: Ensure this runs your app
// ... your other scripts
"start-app-with-nyc": "nyc --nycrc-path .ht-nycrc npm start",
"ht:test": "htcli start-new-test --config-file-path .htConf.js",
"ht:update-coverage": "htcli update-coverage --config-file-path .htConf.js --deduplicate",
"ht:update-packages": "htcli update-ht-packages --package-manager npm --config-file-path ./.htConf.js"
}
}2. Install Packages
3. Add Config Files in project root
1. .ht-nycrc (Tells nyc how to report coverage for HyperTest)
2. .htConf.js (Main configuration for the HyperTest CLI)
2. Instrument Your Application
1. Initialize the SDK
2. Mark the App as Ready
3. Capture & Establish Baseline
1. Capture Tests
2. Establish Coverage Baseline
4. Catch Your First Bug!
1. Make a code change
2. Run the Test
3. See the Results
Last updated