This repository was archived by the owner on Nov 22, 2024. It is now read-only.
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';
1616import { URL } from 'url' ;
1717import { CustomResourceLoader } from './custom-resource-loader' ;
1818import { InlineCriticalCssProcessor } from './inline-css-processor' ;
19+ import { augmentWindowWithStubs } from './stubs' ;
1920
2021export interface RenderOptions {
2122 headers ?: Record < string , string | undefined | string [ ] > ;
@@ -73,6 +74,7 @@ export class Engine {
7374 referrer : options . headers ?. referrer as string | undefined ,
7475 userAgent : options . headers ?. [ 'user-agent' ] as string | undefined ,
7576 beforeParse : ( window ) => {
77+ augmentWindowWithStubs ( window ) ;
7678 window . ngRenderMode = true ;
7779 } ,
7880 } ) ;
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