Add definitions for cypress-cucumber-preprocessor (#36289)

* Add definitions for cypress-cucumber-preprocessor

Add tests for cypress-cucumber-preprocessor

* Add all step types for cypress-cucumber-preprocessor

* Add index types for cypress-cucumber-preprocessor
This commit is contained in:
Alec Brunelle
2019-06-27 10:59:22 -07:00
committed by Daniel Rosenwasser
parent 4070665056
commit 7add76b49b
5 changed files with 55 additions and 0 deletions
@@ -0,0 +1,4 @@
import { Then, Given } from 'cypress-cucumber-preprocessor/steps';
Then(`I see {string} in the title`, (title: string) => {}); // $ExpectType void
Given('I open Google page', () => {}); // $ExpectType void
+11
View File
@@ -0,0 +1,11 @@
// Type definitions for cypress-cucumber-preprocessor 1.12
// Project: https://github.com/TheBrainFamily/cypress-cucumber-preprocessor
// Definitions by: Alec Brunelle <https://github.com/aleccool213>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export default function preprocessor(options?: any): (file: any) => Promise<string>;
/**
* @returns NodeJS.ReadableStream
*/
export function transform(file: any): any;
+14
View File
@@ -0,0 +1,14 @@
export function given(expression: RegExp | string, implementation: (...args: any[]) => void): void;
export function when(expression: RegExp | string, implementation: (...args: any[]) => void): void;
export function then(expression: RegExp | string, implementation: (...args: any[]) => void): void;
export function and(expression: RegExp | string, implementation: (...args: any[]) => void): void;
export function but(expression: RegExp | string, implementation: (...args: any[]) => void): void;
export function defineStep(expression: RegExp | string, implementation: (...args: any[]) => void): void;
export function defineParameterType(): void;
// Aliased versions of the above funcs.
export function Given(expression: RegExp | string, implementation: (...args: any[]) => void): void;
export function When(expression: RegExp | string, implementation: (...args: any[]) => void): void;
export function Then(expression: RegExp | string, implementation: (...args: any[]) => void): void;
export function And(expression: RegExp | string, implementation: (...args: any[]) => void): void;
export function But(expression: RegExp | string, implementation: (...args: any[]) => void): void;
@@ -0,0 +1,25 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"target": "es6"
},
"files": [
"index.d.ts",
"steps/index.d.ts",
"cypress-cucumber-preprocessor-tests.ts"
]
}
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }