File tree Expand file tree Collapse file tree 2 files changed +50
-0
lines changed
packages/angular_devkit/build_angular/src/builders/web-test-runner Expand file tree Collapse file tree 2 files changed +50
-0
lines changed Original file line number Diff line number Diff line change
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+
9
+ import { BuilderContext } from '@angular-devkit/architect' ;
10
+ import { Schema as WtrBuilderOptions } from './schema' ;
11
+
12
+ const UNSUPPORTED_OPTIONS : Array < keyof WtrBuilderOptions > = [
13
+ 'main' ,
14
+ 'assets' ,
15
+ 'scripts' ,
16
+ 'styles' ,
17
+ 'inlineStyleLanguage' ,
18
+ 'stylePreprocessorOptions' ,
19
+ 'sourceMap' ,
20
+ 'progress' ,
21
+ 'poll' ,
22
+ 'preserveSymlinks' ,
23
+ 'browsers' ,
24
+ 'codeCoverage' ,
25
+ 'codeCoverageExclude' ,
26
+ 'fileReplacements' ,
27
+ 'webWorkerTsConfig' ,
28
+ ] ;
29
+
30
+ /** Logs a warning for any unsupported options specified. */
31
+ export function logBuilderStatusWarnings ( options : WtrBuilderOptions , ctx : BuilderContext ) {
32
+ // Validate supported options
33
+ for ( const unsupportedOption of UNSUPPORTED_OPTIONS ) {
34
+ const value = ( options as unknown as WtrBuilderOptions ) [ unsupportedOption ] ;
35
+
36
+ if ( value === undefined || value === false ) {
37
+ continue ;
38
+ }
39
+ if ( Array . isArray ( value ) && value . length === 0 ) {
40
+ continue ;
41
+ }
42
+ if ( typeof value === 'object' && Object . keys ( value ) . length === 0 ) {
43
+ continue ;
44
+ }
45
+
46
+ ctx . logger . warn ( `The '${ unsupportedOption } ' option is not yet supported by this builder.` ) ;
47
+ }
48
+ }
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import path from 'path';
16
16
import { findTestFiles } from '../../utils/test-files' ;
17
17
import { buildApplicationInternal } from '../application' ;
18
18
import { OutputHashing } from '../browser-esbuild/schema' ;
19
+ import { logBuilderStatusWarnings } from './builder-status-warnings' ;
19
20
import { WtrBuilderOptions , normalizeOptions } from './options' ;
20
21
import { Schema } from './schema' ;
21
22
@@ -24,6 +25,7 @@ export default createBuilder(
24
25
ctx . logger . warn (
25
26
'NOTE: The Web Test Runner builder is currently EXPERIMENTAL and not ready for production use.' ,
26
27
) ;
28
+ logBuilderStatusWarnings ( schema , ctx ) ;
27
29
28
30
const options = normalizeOptions ( schema ) ;
29
31
const testDir = 'dist/test-out' ;
You can’t perform that action at this time.
0 commit comments