Support --url-query in curl import

This commit is contained in:
Gregory Schier
2024-12-31 07:21:14 -08:00
parent ab48f118af
commit f8b211be1c
2 changed files with 65 additions and 34 deletions

View File

@@ -310,6 +310,23 @@ describe('importer-curl', () => {
});
});
test('Imports query params', () => {
expect(pluginHookImport(ctx, 'curl "https://yaak.app" --url-query foo=bar --url-query baz=qux')).toEqual({
resources: {
workspaces: [baseWorkspace()],
httpRequests: [
baseRequest({
url: 'https://yaak.app',
urlParameters: [
{ name: 'foo', value: 'bar', enabled: true },
{ name: 'baz', value: 'qux', enabled: true },
],
}),
],
},
});
});
test('Imports query params from the URL', () => {
expect(pluginHookImport(ctx, 'curl "https://yaak.app?foo=bar&baz=a%20a"')).toEqual({
resources: {