(jsContents: string)
| 1125 | `; |
| 1126 | |
| 1127 | const verifyOutput = (jsContents: string) => { |
| 1128 | // verify that there is no pattern that triggers automatic semicolon |
| 1129 | // insertion by checking that there are no function return statements |
| 1130 | // not wrapped in parentheses |
| 1131 | expect(trim(jsContents)).not.toMatch(/return\s+function/); |
| 1132 | expect(trim(jsContents)).toContain( |
| 1133 | trim(` |
| 1134 | [{ |
| 1135 | provide: 'token-a', |
| 1136 | useFactory: ((service) => { |
| 1137 | return (() => service.id); |
| 1138 | }) |
| 1139 | }, { |
| 1140 | provide: 'token-b', |
| 1141 | useFactory: (function (service) { |
| 1142 | return (function () { return service.id; }); |
| 1143 | }) |
| 1144 | }] |
| 1145 | `), |
| 1146 | ); |
| 1147 | }; |
| 1148 | |
| 1149 | it('should wrap functions in "providers" list in NgModule', () => { |
| 1150 | env.tsconfig({ |
no test coverage detected
searching dependent graphs…