mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
feat(karma-mocha): types for v1.3 (#42371)
- type definition - tests Thanks!
This commit is contained in:
parent
2112ad14c8
commit
fca28df8dd
22
types/karma-mocha/index.d.ts
vendored
Normal file
22
types/karma-mocha/index.d.ts
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
// Type definitions for karma-mocha 1.3
|
||||
// Project: https://github.com/karma-runner/karma-mocha#readme
|
||||
// Definitions by: Piotr Błażejewicz (Peter Blazejewicz) <https://github.com/peterblazejewicz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 3.2
|
||||
|
||||
import 'karma';
|
||||
|
||||
declare module 'karma' {
|
||||
interface ClientOptions {
|
||||
mocha?: MochaClientOptions;
|
||||
}
|
||||
|
||||
interface MochaClientOptions {
|
||||
/** This will be exposed in a reporter as `result.mocha.{exportedValue}` */
|
||||
export?: string[];
|
||||
/** You can set opts to equal true then plugin will load opts from default location 'test/mocha.opts' */
|
||||
opts?: true | string;
|
||||
/** any supported Mocha configuration options */
|
||||
[key: string]: any;
|
||||
}
|
||||
}
|
||||
41
types/karma-mocha/karma-mocha-tests.ts
Normal file
41
types/karma-mocha/karma-mocha-tests.ts
Normal file
@ -0,0 +1,41 @@
|
||||
import karma = require('karma');
|
||||
|
||||
module.exports = (config: karma.Config) => {
|
||||
config.set({
|
||||
frameworks: ['mocha', 'chai'],
|
||||
files: ['src/**/*.js', 'test/**/*.js'],
|
||||
reporters: ['progress'],
|
||||
port: 9876, // karma web server port
|
||||
colors: true,
|
||||
logLevel: config.LOG_INFO,
|
||||
browsers: ['Chrome'],
|
||||
autoWatch: false,
|
||||
concurrency: Infinity,
|
||||
client: {
|
||||
mocha: {
|
||||
// karma-mocha options
|
||||
expose: ['body '],
|
||||
// opts: './test/mocha.opts',
|
||||
opts: true,
|
||||
// mocha options
|
||||
ui: 'bdd',
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const mochaClientOptionsTestOne: karma.MochaClientOptions = {
|
||||
expose: [],
|
||||
opts: true,
|
||||
ui: 'bdd',
|
||||
};
|
||||
|
||||
const mochaClientOptionsTestTwo: karma.MochaClientOptions = {
|
||||
expose: ['body'],
|
||||
opts: 'test/mocha.opts',
|
||||
ui: 'bdd',
|
||||
};
|
||||
|
||||
const mochaClientOptionsTestThree: karma.MochaClientOptions = {
|
||||
ui: 'bdd',
|
||||
};
|
||||
23
types/karma-mocha/tsconfig.json
Normal file
23
types/karma-mocha/tsconfig.json
Normal file
@ -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-mocha-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/karma-mocha/tslint.json
Normal file
1
types/karma-mocha/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user