You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/angular/cli/src/commands/mcp/tools/onpush-zoneless-migration/analyze_for_unsupported_zone_uses.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@
6
6
* found in the LICENSE file at https://angular.dev/license
Copy file name to clipboardExpand all lines: packages/angular/cli/src/commands/mcp/tools/onpush-zoneless-migration/prompts.ts
+6-24Lines changed: 6 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -7,8 +7,8 @@
7
7
*/
8
8
9
9
importtype{Node,SourceFile}from'typescript';
10
-
import{MigrationResponse}from'./types';
11
10
import{loadTypescript}from'./ts_utils';
11
+
import{MigrationResponse}from'./types';
12
12
13
13
/* eslint-disable max-len */
14
14
@@ -35,31 +35,13 @@ export function createProvideZonelessForTestsSetupPrompt(testFilePath: string):
35
35
});
36
36
\`\`\`
37
37
38
-
#### Step 2: Identify and Isolate Failing Tests
39
-
40
-
After enabling zoneless detection for the suite, some tests will likely fail. Your next task is to identify these failing tests and temporarily revert them to use Zone.js-based change detection. This isolates them for a future fix.
41
-
42
-
For each test (\`it\` block) or group of tests (\`describe\` block) that fails, override the testbed configuration to use \`provideZoneChangeDetection\`.
43
-
44
-
\`\`\`typescript
45
-
// Example for a single failing test
46
-
it('should do something that fails in zoneless', () => {
47
-
TestBed.configureTestingModule({
48
-
providers: [provideZoneChangeDetection()]
49
-
});
50
-
// ... rest of the test
51
-
});
52
-
\`\`\`
38
+
#### Step 2: Identify and fix Failing Tests
53
39
54
-
### IMPORTANT: Rules and Constraints
40
+
After enabling zoneless detection for the suite, some tests will likely fail. Your next task is to identify these failing tests and fix them.
55
41
56
-
You must follow these rules without exception:
57
-
1. **DO** add \`provideZonelessChangeDetection()\` _once_ to the top-most \`describe\` in a \`beforeEach\` block as instructed in Step 1.
58
-
2. **DO** run the tests after adding \`provideZonelessChangeDetection\` to see which ones fail. **DO NOT** make assumptions about which tests will might fail.
59
-
3. **DO** add \`provideZoneChangeDetection()\` to the providers for each individual test or group of tests that fail after the change in Step 1.
60
-
4. **DO NOT** attempt to fix the logic of the failing tests at this stage. The goal is only to enable zoneless for the suite and isolate the incompatible tests.
61
-
5. **DO NOT** make any other changes to the test file or any application code.
62
-
6. **DO NOT** move tests around or create new describe blocks if it can be avoided. Changes are easier to review when code moves around less.
42
+
${testDebuggingGuideText(testFilePath)}
43
+
8. **DO** add \`provideZonelessChangeDetection()\` _once_ to the top-most \`describe\` in a \`beforeEach\` block as instructed in Step 1.
44
+
9. **DO** run the tests after adding \`provideZonelessChangeDetection\` to see which ones fail. **DO NOT** make assumptions about which tests will might fail.
63
45
64
46
### Final Step
65
47
After you have applied all the required changes and followed all the rules, consult this tool again for the next steps in the migration process.`;
0 commit comments