mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
Create definitions for gulp-jasmine@2.4 (#21431)
* Create definitions for gulp-jasmine@2.4 * Fix the 'reporter' property Functionality: - Make the secondary type of the 'reporter' property in JasmineOptions ReadonlyArray<jasmine.CustomReporter> instead of jasmine.CustomReporter[]. Tests: - Add some more tests Testing done: npm run lint gulp-jasmine (with and without the change to verify the tests fail properly) * Remove unnecessary empty namespace.
This commit is contained in:
20
types/gulp-jasmine/gulp-jasmine-tests.ts
Normal file
20
types/gulp-jasmine/gulp-jasmine-tests.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import gulpJasmine = require("gulp-jasmine");
|
||||
import jasmine = require("jasmine");
|
||||
|
||||
const dummyReporter: jasmine.CustomReporter = {};
|
||||
|
||||
gulpJasmine(); // $ExpectType ReadWriteStream
|
||||
gulpJasmine({});
|
||||
gulpJasmine({
|
||||
verbose: true,
|
||||
includeStackTrace: true,
|
||||
reporter: dummyReporter,
|
||||
timeout: 1000,
|
||||
errorOnFail: false,
|
||||
config: {}
|
||||
});
|
||||
gulpJasmine({ reporter: [dummyReporter, dummyReporter] });
|
||||
const readonlyDummyReporters: ReadonlyArray<jasmine.CustomReporter> = [
|
||||
dummyReporter, dummyReporter
|
||||
];
|
||||
gulpJasmine({ reporter: readonlyDummyReporters });
|
||||
50
types/gulp-jasmine/index.d.ts
vendored
Normal file
50
types/gulp-jasmine/index.d.ts
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
// Type definitions for gulp-jasmine 2.4
|
||||
// Project: https://github.com/sindresorhus/gulp-jasmine#readme
|
||||
// Definitions by: Andrey Lalev <https://github.com/andypyrope>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
/// <reference types="node" />
|
||||
/// <reference types="jasmine" />
|
||||
|
||||
interface JasmineOptions {
|
||||
/**
|
||||
* Display spec names in default reporter.
|
||||
*/
|
||||
verbose?: boolean;
|
||||
|
||||
/**
|
||||
* Include stack traces in failures in default reporter.
|
||||
* @default false
|
||||
*/
|
||||
includeStackTrace?: boolean;
|
||||
|
||||
/**
|
||||
* Reporter(s) to use.
|
||||
*/
|
||||
reporter?: jasmine.CustomReporter | ReadonlyArray<jasmine.CustomReporter>;
|
||||
|
||||
/**
|
||||
* Time to wait in milliseconds before a test automatically fails.
|
||||
* @default 5000
|
||||
*/
|
||||
timeout?: number;
|
||||
|
||||
/**
|
||||
* Stops the stream on failed tests.
|
||||
* @default true
|
||||
*/
|
||||
errorOnFail?: boolean;
|
||||
|
||||
/**
|
||||
* Passes the config to Jasmine's loadConfig method.
|
||||
*/
|
||||
config?: object;
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes Jasmine tests. Emits a 'jasmineDone' event on success.
|
||||
* @param options Optional options for the execution of the Jasmine test
|
||||
*/
|
||||
declare function gulpJasmine(options?: JasmineOptions): NodeJS.ReadWriteStream;
|
||||
export = gulpJasmine;
|
||||
23
types/gulp-jasmine/tsconfig.json
Normal file
23
types/gulp-jasmine/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",
|
||||
"gulp-jasmine-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/gulp-jasmine/tslint.json
Normal file
1
types/gulp-jasmine/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user