MCPcopy Index your code
hub / github.com/angular/angular / writeTestCode

Function writeTestCode

packages/compiler-cli/test/ngtsc/xi18n_spec.ts:244–369  ·  view source on GitHub ↗

* Note: the indentation here is load-bearing.

(env: NgtscTestEnvironment)

Source from the content-addressed store, hash-verified

242 * Note: the indentation here is load-bearing.
243 */
244function writeTestCode(env: NgtscTestEnvironment): void {
245 const welcomeMessage = `
246 <!--i18n-->
247 Welcome<!--/i18n-->
248 `;
249 env.write(
250 'src/basic.html',
251 `<div title="translate me" i18n-title="meaning|desc"></div>
252 <p id="welcomeMessage">${welcomeMessage}</p>`,
253 );
254
255 env.write(
256 'src/comp1.ts',
257 `
258 import {Component} from '@angular/core';
259
260 @Component({
261 selector: 'basic',
262 templateUrl: './basic.html',
263 standalone: false,
264 })
265 export class BasicCmp1 {}`,
266 );
267
268 env.write(
269 'src/comp2.ts',
270 `
271 import {Component} from '@angular/core';
272
273 @Component({
274 selector: 'basic2',
275 template: \`<div title="translate me" i18n-title="meaning|desc"></div>
276 <p id="welcomeMessage">${welcomeMessage}</p>\`,
277 standalone: false,
278 })
279 export class BasicCmp2 {}
280 @Component({
281 selector: 'basic4',
282 template: \`<p id="welcomeMessage">${welcomeMessage}</p>\`,
283 standalone: false,
284 })
285 export class BasicCmp4 {}`,
286 );
287
288 env.write(
289 'src/comp3.ts',
290 `
291 import {Component} from '@angular/core';
292
293 @Component({
294 selector: 'basic3',
295 templateUrl: './basic.html',
296 standalone: false,
297 })
298 export class BasicCmp3 {}`,
299 );
300
301 env.write(

Callers 1

xi18n_spec.tsFile · 0.85

Calls 1

writeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…