( rule: Rule, tree: Tree, )
| 30 | } |
| 31 | |
| 32 | async function testRule( |
| 33 | rule: Rule, |
| 34 | tree: Tree, |
| 35 | ): Promise<{ tasks: TaskConfigurationGenerator[]; logs: LogEntry[] }> { |
| 36 | const tasks: TaskConfigurationGenerator[] = []; |
| 37 | const logs: LogEntry[] = []; |
| 38 | const context = { |
| 39 | addTask(task: TaskConfigurationGenerator) { |
| 40 | tasks.push(task); |
| 41 | }, |
| 42 | logger: { |
| 43 | warn(message: string): void { |
| 44 | logs.push({ type: 'warn', message }); |
| 45 | }, |
| 46 | }, |
| 47 | }; |
| 48 | |
| 49 | await callRule(rule, tree, context as unknown as SchematicContext).toPromise(); |
| 50 | |
| 51 | return { tasks, logs }; |
| 52 | } |
| 53 | |
| 54 | describe('addDependency', () => { |
| 55 | it('adds a package to "dependencies" by default', async () => { |
no test coverage detected