mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
feat(karma-jsdom-launcher): new type definition package (#43031)
- type definition - tests https://github.com/badeball/karma-jsdom-launcher#readme Thanks!
This commit is contained in:
parent
40e033c885
commit
418fbfd443
25
types/karma-jsdom-launcher/index.d.ts
vendored
Normal file
25
types/karma-jsdom-launcher/index.d.ts
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
// Type definitions for karma-jsdom-launcher 8.0
|
||||
// Project: https://github.com/badeball/karma-jsdom-launcher#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';
|
||||
import jsdom = require('jsdom');
|
||||
|
||||
declare module 'karma' {
|
||||
interface ConfigOptions {
|
||||
/**
|
||||
* Launcher for jsdom configuration
|
||||
*/
|
||||
jsdomLauncher?: JsdomLauncherOptions;
|
||||
}
|
||||
|
||||
interface JsdomLauncherOptions {
|
||||
/**
|
||||
* You can pass options directly to jsdom as shown below.
|
||||
* See jsdom's own documentation for all supported options.
|
||||
*/
|
||||
jsdom: jsdom.ConstructorOptions;
|
||||
}
|
||||
}
|
||||
24
types/karma-jsdom-launcher/karma-jsdom-launcher-tests.ts
Normal file
24
types/karma-jsdom-launcher/karma-jsdom-launcher-tests.ts
Normal file
@ -0,0 +1,24 @@
|
||||
import karma = require('karma');
|
||||
import jsdom = require('jsdom');
|
||||
|
||||
const resourceLoader = new jsdom.ResourceLoader({
|
||||
proxy: 'http://127.0.0.1:9001',
|
||||
strictSSL: false,
|
||||
userAgent: 'Mellblomenator/9000',
|
||||
});
|
||||
const virtualConsole = new jsdom.VirtualConsole();
|
||||
const cookieJar = new jsdom.CookieJar();
|
||||
|
||||
module.exports = (config: karma.Config) => {
|
||||
config.set({
|
||||
browsers: ['jsdom'],
|
||||
|
||||
jsdomLauncher: {
|
||||
jsdom: {
|
||||
resources: resourceLoader,
|
||||
virtualConsole,
|
||||
cookieJar,
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
24
types/karma-jsdom-launcher/tsconfig.json
Normal file
24
types/karma-jsdom-launcher/tsconfig.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"DOM"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"karma-jsdom-launcher-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/karma-jsdom-launcher/tslint.json
Normal file
1
types/karma-jsdom-launcher/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user