
API testing without the pain
Run declarative HTTP tests quickly from the CLI.
Why Developers Choose Spectest
Execute hundreds of tests in seconds with parallel execution.
Write tests in JavaScript or JSON. No boilerplate, just describe what you expect.
Built for API testing. Smart defaults and intuitive syntax keep you focused.
See It In Action
Here’s how simple API testing becomes with Spectest:
Before: Traditional API Testing
describe('User API', () => {
it('should create user and return 201', async () => {
const response = await fetch('/api/users', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ name: 'John', email: 'john@example.com' })
});
expect(response.status).toBe(201);
const user = await response.json();
expect(user).toHaveProperty('id');
expect(user.name).toBe('John');
expect(user.email).toBe('john@example.com');
});
});
After: Spectest Declarative Testing
export default [
{
name: "Create User",
endpoint: "/api/users",
request: {
method: "POST",
body: { name: "John", email: "john@example.com" },
},
response: {
status: 201,
json: {
id: "@type:number",
name: "John",
email: "john@example.com",
},
},
},
];
That’s it! No setup, no boilerplate, no ceremony. Just describe what you want to test and Spectest handles the execution, validation, and reporting.
Quick Start Guide
Get up and running with the CLI
Define baseUrl in spectest.config.js
Author cases in JavaScript or JSON
Execute suites with clear results
Install Spectest
npm install -g spectest
Create a Config File
// spectest.config.js
export default {
baseUrl: "https://api.example.com",
testDir: "./test",
filePattern: "\.spectest\.",
};
Create Your First Test
// health.spectest.js
export default [
{ name: "Health Check", endpoint: "/health", response: { status: 200 } },
];
Run Your Tests
npx spectest
Ready to Transform Your API Testing?
Comprehensive guides, examples, and API references to get you up to speed quickly
Explore the source code, contribute, or report issues. We ❤️ community feedback!
Join our community or reach out for help
Open Source & MIT Licensed • Spectest is free, open-source software released under the MIT license. Use it anywhere, modify it as needed, and contribute back to help make API testing better for everyone.