Tesults is a reporting service for test automation results, providing a centralized dashboard to visualize and manage test outcomes. The `tesults` npm package, currently stable at version 1.2.1, offers an API client for Node.js applications to upload test data. This version was published in 2017, and while the package itself has not seen recent updates, the Tesults service continually evolves. Its key differentiators include comprehensive test result management, support for aggregating results from various test frameworks and languages, release record keeping for auditable history, and features like release checklists that consolidate automated and manual test tasks. It aids in identifying flaky tests and managing associated bugs, fostering better release readiness.
npm install tesultsVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates installing the Tesults package, configuring it with a token (preferably from environment variables), and uploading a sample set of test results using the callback-based API. It includes examples of passing and failing tests with descriptions and additional parameters.
Consider wrapping the callback-based API in a Promise for async/await usage or using dynamic `import()` for ESM contexts. For new projects, evaluate if newer alternatives exist or if the core Tesults service offers alternative SDKs.
Wrap the `tesults.results` call in a Promise for modern async/await usage:
```javascript
function uploadResults(data) {
return new Promise((resolve, reject) => {
tesults.results(data, (err, response) => {
if (err) return reject(err);
resolve(response);
});
});
}
// Usage:
try {
const response = await uploadResults(data);
// handle response
} catch (error) {
// handle error
}
```Always use environment variables (e.g., `process.env.TESULTS_TOKEN`), a secrets management service, or a secure configuration system to provide your Tesults API token. Avoid committing tokens to version control.
Run `npm install tesults` in your project's root directory to install the package.
Ensure that `const tesults = require('tesults');` (for CommonJS) or `import tesults from 'tesults';` (for ESM with appropriate configuration) is at the top of your file and that `tesults` has not been reassigned.If your file is CommonJS, use `const tesults = require('tesults');`. If your project is ES Modules (`"type": "module"` in `package.json` or `.mjs` files), use `import tesults from 'tesults';` or `const tesults = await import('tesults');` and ensure your Node.js version supports ESM (v12.20.0+ is recommended).No dependency data recorded yet.