Registry / testing / elasticdash-test

elasticdash-test

JSON →
library0.1.1jsnpmunverified

elasticdash-test is an AI-native test runner specifically designed for testing ElasticDash workflows. Currently in early development at version 0.1.19, it provides capabilities for defining, executing, and potentially generating tests with AI assistance, tailored for the ElasticDash ecosystem. Given its `0.x` version, users should expect frequent updates and potential breaking changes as the API and features evolve rapidly. The package differentiates itself by integrating AI directly into the testing process, aiming to streamline workflow validation within ElasticDash environments, contrasting with general-purpose test runners by focusing on this specific use case and its associated data and API structures.

npm install elasticdash-test
INSTALL
IMPORT
SIG · ELASTICDASH-TEST
E
elasticdash-test
testingjavascriptv0.1.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

test
import { test } from 'elasticdash-test';
const { test } = require('elasticdash-test');
Primary entry point for defining individual test cases. ESM-only usage is enforced by Node.js engine requirement.
describe
import { describe } from 'elasticdash-test';
import describe from 'elasticdash-test'; // 'describe' is a named export
Used for grouping related test cases. ESM-only due to Node.js engine requirement. Ensure it's a named import.
configure
import { configure } from 'elasticdash-test';
const configure = require('elasticdash-test').configure;
Used for global configuration, such as setting API keys or ElasticDash connection details. Essential for AI-native features.

Demonstrates defining a test suite for a user management workflow, including global configuration and basic assertions against simulated ElasticDash API interactions. It highlights the use of `test`, `describe`, and `configure`.

import { test, describe, expect, configure } from 'elasticdash-test'; // Configure the test runner with your ElasticDash API key // It's recommended to load this from environment variables. configure({ apiKey: process.env.ELASTICDASH_API_KEY ?? '', endpoint: process.env.ELASTICDASH_API_ENDPOINT ?? 'https://api.elasticdash.com' }); describe('User Management Workflow', () => { test('should create a new user successfully', async () => { // Simulate interaction with an ElasticDash workflow or API // In a real scenario, this would involve calling the ElasticDash API client const newUser = { id: 'user-123', name: 'John Doe', email: 'john.doe@example.com' }; const response = await simulateCreateUser(newUser); expect(response.status).toBe(200); expect(response.body.message).toBe('User created'); expect(response.body.user.name).toBe('John Doe'); }); test('should retrieve an existing user', async () => { const userId = 'user-456'; const user = await simulateGetUser(userId); expect(user).not.toBeNull(); expect(user.id).toBe(userId); expect(user.name).toBe('Jane Doe'); }); }); async function simulateCreateUser(user: any) { // Placeholder for actual ElasticDash API call return Promise.resolve({ status: 200, body: { message: 'User created', user } }); } async function simulateGetUser(id: string) { // Placeholder for actual ElasticDash API call if (id === 'user-456') { return Promise.resolve({ id: 'user-456', name: 'Jane Doe', email: 'jane.doe@example.com' }); } return Promise.resolve(null); } // To run: // 1. Save as 'user.test.ts' // 2. Set ELASTICDASH_API_KEY and ELASTICDASH_API_ENDPOINT environment variables // 3. Run: npx elasticdash-test user.test.ts
elasticdash-test --version
Debug
Known issues
breakingThe package is in early `0.x` development (current version 0.1.19). Frequent breaking changes to the API, configuration, and underlying AI models are highly probable. Users should pin exact versions and review changelogs carefully.
fix
Always pin exact versions in `package.json` (e.g., `"elasticdash-test": "0.1.19"`) and review release notes before upgrading to new `0.x` versions.
affects: >=0.1.0
breakingThis package requires Node.js version 20.0.0 or higher. Running with older Node.js versions will result in errors due to unsupported syntax or APIs.
fix
Upgrade your Node.js environment to version 20.0.0 or later. Use a version manager like `nvm` (`nvm install 20 && nvm use 20`).
affects: <=0.1.19
gotchaConfiguration for ElasticDash API keys and endpoints is critical for the AI-native features to function. Improper or missing configuration will lead to authentication errors or non-functional AI capabilities.
fix
Ensure `configure({ apiKey: process.env.ELASTICDASH_API_KEY, ... })` is called at the entry point of your test setup, with valid credentials preferably loaded from secure environment variables.
affects: >=0.1.0
gotchaAs an ESM-only package, CommonJS `require()` statements are not supported for importing `elasticdash-test` modules. Attempting to use `require` will result in runtime errors.
fix
Always use ES module `import` syntax (e.g., `import { test } from 'elasticdash-test';`). Ensure your project is configured for ESM (e.g., `"type": "module"` in `package.json` or `.mjs` file extension).
affects: >=0.1.0
Errors
Common errors & fixes
Error: Must be run with Node.js version 20.0.0 or higher.
Attempting to run the test runner with an incompatible Node.js version.
fix
Upgrade your Node.js environment to version 20.0.0 or later. Use `nvm install 20 && nvm use 20` or similar.
TypeError: test is not a function
The `test` function (or `describe`, `configure`) was imported incorrectly, often via a default import or a CommonJS `require` call in an ESM context.
fix
Ensure you are using named ES module imports: `import { test, describe, configure } from 'elasticdash-test';`.
Error: ElasticDash API Key not configured. Please set 'apiKey' in configure() or ELASTICDASH_API_KEY environment variable.
The `configure` function was called without an `apiKey` or the `ELASTICDASH_API_KEY` environment variable is missing/empty.
fix
Provide a valid API key through `configure({ apiKey: 'your-key' })` or by setting the `ELASTICDASH_API_KEY` environment variable before running tests.
SyntaxError: Cannot use import statement outside a module
An ES module file (e.g., your test file) is being run in a CommonJS context without proper configuration.
fix
Add `"type": "module"` to your `package.json` or rename your test files to have a `.mjs` extension. Ensure your test runner command respects ESM.
Upgrade
Version history
0.1.1latest on npm
Audit
Dependencies
@elasticdash/workflow-clientrequiredLikely required for interacting with ElasticDash workflows and APIs for test execution and AI integration. (Assumption based on package description)
Agent activity
2 hits · last 30 days
node
2
Resources