How to use the postman-collection.Script function in postman-collection

To help you get started, we’ve selected a few postman-collection examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DefinitelyTyped / DefinitelyTyped / types / postman-collection / postman-collection-tests.ts View on Github external
pmCollection.Response.createFromNode({body: "string", statusCode: 200, elapsedTime: 1}, []); // $ExpectType Response

pmCollection.Response.isResponse(response); // $ExpectType boolean

// ScriptDefinition Tests

const scriptDef: pmCollection.ScriptDefinition = {};
scriptDef.type; // $ExpectType string | undefined
scriptDef.src; // $ExpectType string | Url | undefined
scriptDef.exec; // $ExpectType string | string[] | undefined

// Script Tests

let script = new pmCollection.Script();
script = new pmCollection.Script(scriptDef);
script = new pmCollection.Script("string");
script = new pmCollection.Script(["string"]);

script.exec; // $ExpectType string[] | undefined
script.src; // $ExpectType Url | undefined
script.type; // $ExpectType string

script.update(scriptDef); // $ExpectType void
script.update("string"); // $ExpectType void
script.update(["string"]); // $ExpectType void

script.toSource(); // $ExpectType string | undefined

pmCollection.Script.isScript(script); // $ExpectType boolean

// UrlDefinition Tests
github DefinitelyTyped / DefinitelyTyped / types / postman-collection / postman-collection-tests.ts View on Github external
pmCollection.Response.createFromNode({body: "string", statusCode: 200, elapsedTime: 1}, []); // $ExpectType Response

pmCollection.Response.isResponse(response); // $ExpectType boolean

// ScriptDefinition Tests

const scriptDef: pmCollection.ScriptDefinition = {};
scriptDef.type; // $ExpectType string | undefined
scriptDef.src; // $ExpectType string | Url | undefined
scriptDef.exec; // $ExpectType string | string[] | undefined

// Script Tests

let script = new pmCollection.Script();
script = new pmCollection.Script(scriptDef);
script = new pmCollection.Script("string");
script = new pmCollection.Script(["string"]);

script.exec; // $ExpectType string[] | undefined
script.src; // $ExpectType Url | undefined
script.type; // $ExpectType string

script.update(scriptDef); // $ExpectType void
script.update("string"); // $ExpectType void
script.update(["string"]); // $ExpectType void

script.toSource(); // $ExpectType string | undefined

pmCollection.Script.isScript(script); // $ExpectType boolean

// UrlDefinition Tests
github DefinitelyTyped / DefinitelyTyped / types / postman-collection / postman-collection-tests.ts View on Github external
pmCollection.Response.isResponse(response); // $ExpectType boolean

// ScriptDefinition Tests

const scriptDef: pmCollection.ScriptDefinition = {};
scriptDef.type; // $ExpectType string | undefined
scriptDef.src; // $ExpectType string | Url | undefined
scriptDef.exec; // $ExpectType string | string[] | undefined

// Script Tests

let script = new pmCollection.Script();
script = new pmCollection.Script(scriptDef);
script = new pmCollection.Script("string");
script = new pmCollection.Script(["string"]);

script.exec; // $ExpectType string[] | undefined
script.src; // $ExpectType Url | undefined
script.type; // $ExpectType string

script.update(scriptDef); // $ExpectType void
script.update("string"); // $ExpectType void
script.update(["string"]); // $ExpectType void

script.toSource(); // $ExpectType string | undefined

pmCollection.Script.isScript(script); // $ExpectType boolean

// UrlDefinition Tests

let urlDef: pmCollection.UrlDefinition = {
github DefinitelyTyped / DefinitelyTyped / types / postman-collection / postman-collection-tests.ts View on Github external
response.encoding(); // $ExpectType { format: string; source: string; }

pmCollection.Response.createFromNode({body: "string", statusCode: 200, elapsedTime: 1}, []); // $ExpectType Response

pmCollection.Response.isResponse(response); // $ExpectType boolean

// ScriptDefinition Tests

const scriptDef: pmCollection.ScriptDefinition = {};
scriptDef.type; // $ExpectType string | undefined
scriptDef.src; // $ExpectType string | Url | undefined
scriptDef.exec; // $ExpectType string | string[] | undefined

// Script Tests

let script = new pmCollection.Script();
script = new pmCollection.Script(scriptDef);
script = new pmCollection.Script("string");
script = new pmCollection.Script(["string"]);

script.exec; // $ExpectType string[] | undefined
script.src; // $ExpectType Url | undefined
script.type; // $ExpectType string

script.update(scriptDef); // $ExpectType void
script.update("string"); // $ExpectType void
script.update(["string"]); // $ExpectType void

script.toSource(); // $ExpectType string | undefined

pmCollection.Script.isScript(script); // $ExpectType boolean