Files
DefinitelyTyped/types/newman/newman-tests.ts
Adam 66704170b7 [newman] Updates for Newman version 4.5 (#41466)
* Fixing newman types.

* Update version number.

* Fixing linting issue.

* Adding a test for newman.

* Adding more tests.
2020-01-21 16:41:00 -08:00

43 lines
1.1 KiB
TypeScript

import { EventEmitter } from "events";
import {
run,
NewmanRun,
NewmanRunExecution,
NewmanRunExecutionAssertion,
NewmanRunExecutionAssertionError,
NewmanRunExecutionItem,
NewmanRunFailure,
NewmanRunSummary
} from "newman";
import {
CollectionDefinition,
VariableScopeDefinition
} from "postman-collection";
const collection: CollectionDefinition = {};
const environment: VariableScopeDefinition = {};
const globals: VariableScopeDefinition = {};
const folder: string | string[] = ['collectionFolderA', 'collectionFolderB'];
const color = 'auto';
const workingDir = 'path/to/working/directory';
const insecureFileRead = true;
// $ExpectType EventEmitter
run(
{
collection,
environment,
globals,
folder,
color,
workingDir,
insecureFileRead
},
(err, summary: NewmanRunSummary) => {
summary.run; // $ExpectType NewmanRun
summary.run.executions; // $ExpectType NewmanRunExecution[]
summary.run.failures; // $ExpectType NewmanRunFailure[]
summary.run.failures[0].source; // $ExpectType NewmanRunExecutionItem | undefined
}
);