mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
* Fixing newman types. * Update version number. * Fixing linting issue. * Adding a test for newman. * Adding more tests.
43 lines
1.1 KiB
TypeScript
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
|
|
}
|
|
);
|