From 631ce47c566c388942eddd4d9d8ec605b1b5251d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20B=C5=82a=C5=BCejewicz=20=28Peter=20Blazejewicz=29?= Date: Fri, 27 Mar 2020 18:09:38 +0100 Subject: [PATCH] feat(karma-jasmine-spec-tags): new types defintion for v1.2 (#43051) - definition file - tests https://github.com/mnasyrov/karma-jasmine-spec-tags#readme Thanks! --- types/karma-jasmine-spec-tags/index.d.ts | 34 ++++++++++++++++++ .../karma-jasmine-spec-tags-tests.ts | 35 +++++++++++++++++++ types/karma-jasmine-spec-tags/tsconfig.json | 23 ++++++++++++ types/karma-jasmine-spec-tags/tslint.json | 1 + 4 files changed, 93 insertions(+) create mode 100644 types/karma-jasmine-spec-tags/index.d.ts create mode 100644 types/karma-jasmine-spec-tags/karma-jasmine-spec-tags-tests.ts create mode 100644 types/karma-jasmine-spec-tags/tsconfig.json create mode 100644 types/karma-jasmine-spec-tags/tslint.json diff --git a/types/karma-jasmine-spec-tags/index.d.ts b/types/karma-jasmine-spec-tags/index.d.ts new file mode 100644 index 0000000000..00d43577e6 --- /dev/null +++ b/types/karma-jasmine-spec-tags/index.d.ts @@ -0,0 +1,34 @@ +// Type definitions for karma-jasmine-spec-tags 1.2 +// Project: https://github.com/mnasyrov/karma-jasmine-spec-tags#readme +// Definitions by: Piotr Błażejewicz (Peter Blazejewicz) +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.2 + +import 'karma'; + +// A plugin for karma-jasmine which helps to filter tests (specs) by tags. + +declare module 'karma' { + /** + * Default values can be configured using client map in Karma configuration + */ + interface ClientOptions { + /** + * defines a prefix for a tag name + * @default '#' + */ + tagPrefix?: string; + /** + * defines a comma-separated list of tag names: + * * if `names` is defined then specs which match to tags will be executed. + * * If `names` is not defined then all specs with a tag will be executed. + */ + tags?: string | string[] | boolean; + /** + * defines a comma-separated list of tag names + * * If `names` is defined then specs which match to tags will be skipped. + * * If `names` is not defined then all specs with a tag will be skipped. + */ + skipTags?: string | string[] | boolean; + } +} diff --git a/types/karma-jasmine-spec-tags/karma-jasmine-spec-tags-tests.ts b/types/karma-jasmine-spec-tags/karma-jasmine-spec-tags-tests.ts new file mode 100644 index 0000000000..c7c23d6a6e --- /dev/null +++ b/types/karma-jasmine-spec-tags/karma-jasmine-spec-tags-tests.ts @@ -0,0 +1,35 @@ +import karma = require('karma'); + +module.exports = (config: karma.Config) => { + config.set({ + frameworks: ['jasmine', 'jasmine-spec-tags'], + + client: { + tagPrefix: '@', + tags: 'smoke', + skipTags: 'slow', + }, + }); +}; + +module.exports = (config: karma.Config) => { + config.set({ + frameworks: ['jasmine', 'jasmine-spec-tags'], + + client: { + tags: ['smoke'], + skipTags: ['slow'], + }, + }); +}; + +module.exports = (config: karma.Config) => { + config.set({ + frameworks: ['jasmine', 'jasmine-spec-tags'], + + client: { + tags: false, + skipTags: true, + }, + }); +}; diff --git a/types/karma-jasmine-spec-tags/tsconfig.json b/types/karma-jasmine-spec-tags/tsconfig.json new file mode 100644 index 0000000000..0ae471c236 --- /dev/null +++ b/types/karma-jasmine-spec-tags/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "karma-jasmine-spec-tags-tests.ts" + ] +} diff --git a/types/karma-jasmine-spec-tags/tslint.json b/types/karma-jasmine-spec-tags/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/karma-jasmine-spec-tags/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }