MCPcopy Create free account
hub / github.com/angular/angular / verifyOutput

Function verifyOutput

packages/compiler-cli/test/ngtsc/ngtsc_spec.ts:1162–1170  ·  view source on GitHub ↗
(jsContents: string)

Source from the content-addressed store, hash-verified

1160 `;
1161
1162 const verifyOutput = (jsContents: string) => {
1163 // verify that there is no pattern that triggers automatic semicolon
1164 // insertion by checking that there are no function return statements
1165 // not wrapped in parentheses
1166 expect(trim(jsContents)).not.toMatch(/return\s+function/);
1167 expect(trim(jsContents)).toMatch(
1168 /\[\{\s*provide:\s*['"]token-a['"],\s*useFactory:\s*\(\(service\)\s*=>\s*\{\s*return\s*\(\(\)\s*=>\s*service\.id\);\s*\}\)\s*\},\s*\{\s*provide:\s*['"]token-b['"],\s*useFactory:\s*\(function\s*\(service\)\s*\{\s*return\s*\(function\s*\(\)\s*\{\s*return\s*service\.id;\s*\}\);\s*\}\)\s*\}\]/,
1169 );
1170 };
1171
1172 it('should wrap functions in "providers" list in NgModule', () => {
1173 env.tsconfig({

Callers 1

ngtsc_spec.tsFile · 0.85

Calls 1

trimFunction · 0.70

Tested by

no test coverage detected