File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed
modules/common/clover/server/src Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import * as path from 'path';
16
16
import { URL } from 'url' ;
17
17
import { CustomResourceLoader } from './custom-resource-loader' ;
18
18
import { InlineCriticalCssProcessor } from './inline-css-processor' ;
19
+ import { augmentWindowWithStubs } from './stubs' ;
19
20
20
21
export interface RenderOptions {
21
22
headers ?: Record < string , string | undefined | string [ ] > ;
@@ -73,6 +74,7 @@ export class Engine {
73
74
referrer : options . headers ?. referrer as string | undefined ,
74
75
userAgent : options . headers ?. [ 'user-agent' ] as string | undefined ,
75
76
beforeParse : ( window ) => {
77
+ augmentWindowWithStubs ( window ) ;
76
78
window . ngRenderMode = true ;
77
79
} ,
78
80
} ) ;
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 { DOMWindow } from 'jsdom' ;
10
+
11
+ function noop ( ) : void { }
12
+
13
+ export function augmentWindowWithStubs ( window : DOMWindow ) : void {
14
+ window . resizeBy = noop ;
15
+ window . resizeTo = noop ;
16
+ window . scroll = noop ;
17
+ window . scrollBy = noop ;
18
+ window . scrollTo = noop ;
19
+ }
You can’t perform that action at this time.
0 commit comments