1.0.0 • Published 3 months ago
@stuntman/client v1.0.0
Stuntman API client
Client for Stuntman proxy/mock server API
Example usage
import { Client } from './apiClient';
import { ruleBuilder } from './ruleBuilder';
const client = new Client();
const uniqueQaUserEmail = 'unique_qa_email@example.com';
const rule = ruleBuilder()
.limitedUse(2)
.onRequestToHostname('example.com')
.withSearchParam('user', uniqueQaUserEmail)
.mockResponse({
localFn: (req) => {
if (JSON.parse(req.body).email !== uniqueQaUserEmail) {
return {
status: 500,
};
}
return { status: 201 };
},
localVariables: { uniqueQaUserEmail },
});
client.addRule(rule).then((x) => console.log(x));
Check example app for more samples
1.0.0
3 months ago
0.3.7
5 months ago
0.3.6
11 months ago
0.3.0
1 year ago
0.3.5
1 year ago
0.3.2
1 year ago
0.3.1
1 year ago
0.3.4
1 year ago
0.3.3
1 year ago
0.2.4
1 year ago
0.2.3
1 year ago
0.2.2
2 years ago
0.1.11
2 years ago
0.2.1
2 years ago
0.2.0
2 years ago
0.1.10
2 years ago
0.1.8
2 years ago
0.1.9
2 years ago
0.1.7
2 years ago
0.1.6
2 years ago
0.1.5
2 years ago
0.1.4
2 years ago
0.1.3
2 years ago
0.1.2
2 years ago
0.1.1
2 years ago
0.1.0
2 years ago