mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Add jest-cucumber-fusion (#43487)
* Add jest-cucumber-fusion * Add 'declare module' * Add support for Gherkin tables * Fix failing tests for jest-cucumber-fusion - Set minimum ts version - Fix linting errors
This commit is contained in:
parent
bcdbb10669
commit
93d70f87d5
20
types/jest-cucumber-fusion/index.d.ts
vendored
Normal file
20
types/jest-cucumber-fusion/index.d.ts
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
// Type definitions for jest-cucumber-fusion 0.6
|
||||
// Project: https://github.com/b-yond-infinite-network/jest-cucumber-fusion#readme
|
||||
// Definitions by: Pelle Johnsen <https://github.com/pjoe>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// Minimum TypeScript Version: 3.4
|
||||
|
||||
import { loadFeature } from 'jest-cucumber';
|
||||
|
||||
export type CallBack = (...args: ReadonlyArray<string | Array<Record<string, string>>>) => void | Promise<void>;
|
||||
|
||||
export function Given(name: string | RegExp, callback: CallBack): void;
|
||||
export function When(name: string | RegExp, callback: CallBack): void;
|
||||
export function Then(name: string | RegExp, callback: CallBack): void;
|
||||
export function And(name: string | RegExp, callback: CallBack): void;
|
||||
export function But(name: string | RegExp, callback: CallBack): void;
|
||||
|
||||
export function Before(callback: () => void | Promise<void>): void;
|
||||
export function After(callback: () => void | Promise<void>): void;
|
||||
|
||||
export function Fusion(feature: string, options?: Parameters<typeof loadFeature>[1]): void;
|
||||
32
types/jest-cucumber-fusion/jest-cucumber-fusion-tests.ts
Normal file
32
types/jest-cucumber-fusion/jest-cucumber-fusion-tests.ts
Normal file
@ -0,0 +1,32 @@
|
||||
import * as jcf from 'jest-cucumber-fusion';
|
||||
|
||||
type CbArgs = ReadonlyArray<string | Array<Record<string, string>>>;
|
||||
function cb(...args: CbArgs): void {}
|
||||
async function cbAsync(...args: CbArgs): Promise<void> {}
|
||||
|
||||
jcf.Given('', cb); // $ExpectType void
|
||||
jcf.Given('', cbAsync); // $ExpectType void
|
||||
|
||||
jcf.When('', cb); // $ExpectType void
|
||||
jcf.When('', cbAsync); // $ExpectType void
|
||||
|
||||
jcf.Then('', cb); // $ExpectType void
|
||||
jcf.Then('', cbAsync); // $ExpectType void
|
||||
|
||||
jcf.And('', cb); // $ExpectType void
|
||||
jcf.And('', cbAsync); // $ExpectType void
|
||||
|
||||
jcf.But('', cb); // $ExpectType void
|
||||
jcf.But('', cbAsync); // $ExpectType void
|
||||
|
||||
jcf.After(() => {}); // $ExpectType void
|
||||
jcf.After(async () => {}); // $ExpectType void
|
||||
|
||||
jcf.Before(() => {}); // $ExpectType void
|
||||
jcf.Before(async () => {}); // $ExpectType void
|
||||
|
||||
jcf.Fusion(''); // $ExpectType void
|
||||
jcf.Fusion('', { errors: true }); // $ExpectType void
|
||||
jcf.Fusion('', { loadRelativePath: true }); // $ExpectType void
|
||||
jcf.Fusion('', { scenarioNameTemplate: vars => vars.featureTitle }); // $ExpectType void
|
||||
jcf.Fusion('', { tagFilter: '' }); // $ExpectType void
|
||||
6
types/jest-cucumber-fusion/package.json
Normal file
6
types/jest-cucumber-fusion/package.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"jest-cucumber": "^2.0.11"
|
||||
}
|
||||
}
|
||||
24
types/jest-cucumber-fusion/tsconfig.json
Normal file
24
types/jest-cucumber-fusion/tsconfig.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"jest-cucumber-fusion-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/jest-cucumber-fusion/tslint.json
Normal file
1
types/jest-cucumber-fusion/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user