From a7cf63fbe58c0286bf403ff34cf9fda5947146e4 Mon Sep 17 00:00:00 2001 From: George He Date: Tue, 21 May 2024 10:45:00 +0800 Subject: [PATCH] test: add a test case for importing scripts --- .../__snapshots__/index.test.ts.snap | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/packages/insomnia/src/utils/importers/importers/__snapshots__/index.test.ts.snap b/packages/insomnia/src/utils/importers/importers/__snapshots__/index.test.ts.snap index d468791281..1b7df671b2 100644 --- a/packages/insomnia/src/utils/importers/importers/__snapshots__/index.test.ts.snap +++ b/packages/insomnia/src/utils/importers/importers/__snapshots__/index.test.ts.snap @@ -5749,6 +5749,42 @@ exports[`Fixtures Import postman postman-export-oauth2-v2_1-input.json 1`] = ` } `; +exports[`Fixtures Import postman scripts-import-v2_1-input.json 1`] = ` +{ + "__export_date": "", + "__export_format": 4, + "__export_source": "insomnia.importers:v0.1.0", + "_type": "export", + "resources": [ + { + "_id": "__GRP_1__", + "_type": "request_group", + "description": "", + "environment": {}, + "metaSortKey": -1622117984000, + "name": "New Collection", + "parentId": "__WORKSPACE_ID__", + }, + { + "_id": "__REQ_1__", + "_type": "request", + "authentication": {}, + "body": {}, + "description": "", + "headers": [], + "metaSortKey": -1622117983999, + "method": "GET", + "name": "New Request", + "parameters": [], + "parentId": "__GRP_1__", + "postRequestScript": "console.log('this is test script');", + "preRequestScript": "console.log('this is pre-request script');", + "url": "httpbin.org/get", + }, + ], +} +`; + exports[`Fixtures Import postman-env basic-input.json 1`] = ` { "__export_date": "",