zephyr-scale-client
Version:
Minimal JavaScript client for Zephyr Scale (Cloud) REST API. ESM, Node >=18.
19 lines (18 loc) • 672 B
JavaScript
export function api(client) {
return {
async list(testCaseKey, { startAt = 0, maxResults = 100 } = {}) {
if (!testCaseKey) throw new Error('testCaseKey is required');
return client._request(`/v2/testcases/${encodeURIComponent(testCaseKey)}/teststeps`, {
query: { startAt, maxResults }
});
},
async create(testCaseKey, step) {
if (!testCaseKey) throw new Error('testCaseKey is required');
if (!step?.description) throw new Error('step.description is required');
return client._request(`/v2/testcases/${encodeURIComponent(testCaseKey)}/teststeps`, {
method: 'POST',
body: step
});
}
};
}