| 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({ |