mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
feat(open-wc/testing-karma): new type definition (#43169)
- definition file - tests https://github.com/open-wc/open-wc/tree/master/packages/testing-karma#extending-the-config Thanks!
This commit is contained in:
parent
94403d6d8f
commit
8379f5d24f
16
types/open-wc__testing-karma/index.d.ts
vendored
Normal file
16
types/open-wc__testing-karma/index.d.ts
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
// Type definitions for @open-wc/testing-karma 3.3
|
||||
// Project: https://github.com/open-wc/open-wc/tree/master/packages/testing-karma
|
||||
// Definitions by: Piotr Błażejewicz <https://github.com/peterblazejewicz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 3.2
|
||||
|
||||
import karma = require('karma');
|
||||
|
||||
/**
|
||||
* Our configuration sets up karma to run tests based on es modules with the necessary polyfills
|
||||
* and fallbacks for older browsers and convenient test reporting.
|
||||
* To extend the karma config, we recommend using `deepmerge`.
|
||||
* This will do smart merging of complex objects.
|
||||
* You can extend any of the configuration.
|
||||
*/
|
||||
export function createDefaultConfig(config: karma.Config): karma.Config;
|
||||
37
types/open-wc__testing-karma/open-wc__testing-karma-tests.ts
Normal file
37
types/open-wc__testing-karma/open-wc__testing-karma-tests.ts
Normal file
@ -0,0 +1,37 @@
|
||||
import { createDefaultConfig } from '@open-wc/testing-karma';
|
||||
import merge = require('lodash/merge');
|
||||
import karma = require('karma');
|
||||
|
||||
module.exports = (config: karma.Config) => {
|
||||
// defaults
|
||||
const defaultConfig = createDefaultConfig(config);
|
||||
// sets config merging defaults with custom settings
|
||||
config.set(
|
||||
merge(defaultConfig, {
|
||||
logLevel: config.LOG_DEBUG,
|
||||
basePath: '..',
|
||||
urlRoot: '/base/',
|
||||
frameworks: ['jasmine'],
|
||||
files: [
|
||||
{ pattern: 'lib/angular.js', watched: false },
|
||||
'test/unit/*.spec.js',
|
||||
{ pattern: 'compiled/index.html', watched: false },
|
||||
{ pattern: 'app/index.html', included: false, served: false },
|
||||
{ pattern: 'compiled/app.js.map', included: false, served: true, watched: false, nocache: true },
|
||||
{ pattern: 'test/images/*.jpg', watched: false, included: false, served: true, nocache: false },
|
||||
],
|
||||
loggers: {
|
||||
custom: { type: 'file', filename: 'log.txt' },
|
||||
},
|
||||
reporters: ['progress', 'coverage'],
|
||||
middleware: ['foo', 'bar'],
|
||||
beforeMiddleware: ['foo', 'bar'],
|
||||
mime: {
|
||||
'text/x-typescript': ['ts', 'tsx'],
|
||||
},
|
||||
preprocessors: {
|
||||
'app.js': ['coverage'],
|
||||
},
|
||||
}),
|
||||
);
|
||||
};
|
||||
28
types/open-wc__testing-karma/tsconfig.json
Normal file
28
types/open-wc__testing-karma/tsconfig.json
Normal file
@ -0,0 +1,28 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"paths": {
|
||||
"@open-wc/testing-karma": [
|
||||
"open-wc__testing-karma"
|
||||
]
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"open-wc__testing-karma-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/open-wc__testing-karma/tslint.json
Normal file
1
types/open-wc__testing-karma/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user