0.3.5 • Published 10 days ago
@stuntman/client v0.3.5
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
0.3.0
10 days ago
0.3.5
10 days ago
0.3.2
10 days ago
0.3.1
10 days ago
0.3.4
10 days ago
0.3.3
10 days ago
0.2.4
2 months ago
0.2.3
4 months ago
0.2.2
4 months ago
0.1.11
1 year ago
0.2.1
1 year ago
0.2.0
1 year ago
0.1.10
1 year ago
0.1.8
1 year ago
0.1.9
1 year ago
0.1.7
1 year ago
0.1.6
1 year ago
0.1.5
1 year ago
0.1.4
1 year ago
0.1.3
1 year ago
0.1.2
1 year ago
0.1.1
1 year ago
0.1.0
1 year ago