|
8 | 8 |
|
9 | 9 | /* eslint-disable import/no-extraneous-dependencies */ |
10 | 10 | import { normalize } from '@angular-devkit/core'; |
11 | | -import { of as observableOf } from 'rxjs'; |
| 11 | +import { lastValueFrom, of as observableOf } from 'rxjs'; |
12 | 12 | import { UnitTestTree } from '../../testing'; |
13 | 13 | import { SchematicContext } from '../engine/interface'; |
14 | 14 | import { HostTree } from '../tree/host-tree'; |
@@ -188,10 +188,10 @@ describe('contentTemplate', () => { |
188 | 188 | const operator = applyContentTemplate({ foobar: 1 }); |
189 | 189 |
|
190 | 190 | expect(() => operator(_entry('/a/b/file.ts', 'a<%= foobat %>b'))).toThrowError( |
191 | | - 'Failed to apply template "/a/b/file.ts": ReferenceError: foobat is not defined', |
| 191 | + 'Failed to apply content template to "/a/b/file.ts": foobat is not defined', |
192 | 192 | ); |
193 | 193 | expect(() => operator(_entry('/a/b/file.ts', 'a<%= foobar unintended %>b'))).toThrowError( |
194 | | - /^Failed to apply template "\/a\/b\/file\.ts": SyntaxError: /, |
| 194 | + /^Failed to apply content template to "\/a\/b\/file\.ts": Unexpected identifier/, |
195 | 195 | ); |
196 | 196 | }); |
197 | 197 |
|
@@ -239,7 +239,9 @@ describe('applyTemplateFiles', () => { |
239 | 239 | } as SchematicContext; |
240 | 240 |
|
241 | 241 | await expectAsync( |
242 | | - callRule(applyTemplates({ a: 'foo' }), observableOf(tree), context).toPromise(), |
243 | | - ).toBeRejectedWithError(/^Failed to apply template "\/a\/b\/file__a__\.template": TypeError: /); |
| 242 | + lastValueFrom(callRule(applyTemplates({ a: 'foo' }), observableOf(tree), context)), |
| 243 | + ).toBeRejectedWithError( |
| 244 | + /^Failed to apply content template to "\/a\/b\/file__a__\.template": Cannot read /, |
| 245 | + ); |
244 | 246 | }); |
245 | 247 | }); |
0 commit comments