-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathsingle-test-transform.d.ts
28 lines (28 loc) · 1.06 KB
/
single-test-transform.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { logging } from '@angular-devkit/core';
import { loader } from 'webpack';
export interface SingleTestTransformLoaderOptions {
files: string[];
logger: logging.Logger;
}
export declare const SingleTestTransformLoader: string;
/**
* This loader transforms the default test file to only run tests
* for some specs instead of all specs.
* It works by replacing the known content of the auto-generated test file:
* const context = require.context('./', true, /\.spec\.ts$/);
* context.keys().map(context);
* with:
* const context = { keys: () => ({ map: (_a) => { } }) };
* context.keys().map(context);
* So that it does nothing.
* Then it adds import statements for each file in the files options
* array to import them directly, and thus run the tests there.
*/
export default function loader(this: loader.LoaderContext, source: string): string;