mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-21 05:20:24 +08:00
Added new package @types/artillery (#20779)
* Artillery types for beforeRequest & afterResponse hooks * Remove unnecessary linting rule in Artillery project * Update Artillery tests to define variables to ensure proper compilation usage * Fix compilation errors in test & move typescript decl to line 5
This commit is contained in:
13
types/artillery/artillery-tests.ts
Normal file
13
types/artillery/artillery-tests.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { ScenarioContext, Next } from 'artillery';
|
||||
|
||||
const scenarioContext: ScenarioContext = {vars: {}};
|
||||
scenarioContext.vars = {};
|
||||
scenarioContext.vars.testing = "value";
|
||||
scenarioContext.vars.testing2 = 1;
|
||||
|
||||
const next: Next = (error?: Error) => {
|
||||
// do nothing.
|
||||
};
|
||||
|
||||
next();
|
||||
next(new Error());
|
||||
13
types/artillery/index.d.ts
vendored
Normal file
13
types/artillery/index.d.ts
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
// Type definitions for artillery 1.6
|
||||
// Project: https://github.com/shoreditch-ops/artillery#readme
|
||||
// Definitions by: Kira McCoan <https://github.com/kmccoan-allocadia>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
import * as request from 'request';
|
||||
import * as events from 'events';
|
||||
|
||||
export interface ScenarioContext { vars: {[key: string]: any}; }
|
||||
export type Next = (err?: Error) => void;
|
||||
export type ResponseRequest = request.ResponseRequest;
|
||||
export type RequestResponse = request.RequestResponse;
|
||||
export type EventEmitter = events.EventEmitter;
|
||||
23
types/artillery/tsconfig.json
Normal file
23
types/artillery/tsconfig.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"artillery-tests.ts"
|
||||
]
|
||||
}
|
||||
3
types/artillery/tslint.json
Normal file
3
types/artillery/tslint.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Reference in New Issue
Block a user