Fix curl import when using boolean flags

This commit is contained in:
Gregory Schier
2024-10-08 14:49:03 -07:00
parent 9df586cb59
commit 9291950554
2 changed files with 25 additions and 2 deletions

View File

@@ -196,6 +196,27 @@ describe('importer-curl', () => {
});
});
test('Imports post data into URL', () => {
expect(
pluginHookImport(ctx, 'curl -G https://api.stripe.com/v1/payment_links -d limit=3'),
).toEqual({
resources: {
workspaces: [baseWorkspace()],
httpRequests: [
baseRequest({
method: 'GET',
url: 'https://api.stripe.com/v1/payment_links',
urlParameters: [{
enabled: true,
name: 'limit',
value: '3',
}]
}),
],
},
});
});
test('Imports multi-line JSON', () => {
expect(
pluginHookImport(