@jscutlery/playwright-ct-angular 0.6.5 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -1
- package/package.json +1 -1
- package/register-source.mjs +0 -2
package/README.md
CHANGED
|
@@ -281,7 +281,7 @@ Cf. https://youtu.be/y3YxX4sFJbM
|
|
|
281
281
|
|
|
282
282
|
Cf. https://github.com/microsoft/playwright/blob/cac67fb94f2c8a0ee82878054c39790e660f17ca/packages/playwright-test/src/tsxTransform.ts#L153
|
|
283
283
|
|
|
284
|
-
###
|
|
284
|
+
###
|
|
285
285
|
|
|
286
286
|
# 📦 Setup
|
|
287
287
|
|
|
@@ -347,3 +347,34 @@ const config: PlaywrightTestConfig = {
|
|
|
347
347
|
...
|
|
348
348
|
}
|
|
349
349
|
```
|
|
350
|
+
|
|
351
|
+
### 4. Choose between zoneful or zoneless testing
|
|
352
|
+
|
|
353
|
+
#### Zoneful Testing
|
|
354
|
+
|
|
355
|
+
If you want to use zoneful testing, you have to import `zone.js` in your `playwright/index.ts`:
|
|
356
|
+
|
|
357
|
+
```ts
|
|
358
|
+
// playwright/index.ts
|
|
359
|
+
import 'zone.js';
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
#### Zoneless Testing
|
|
363
|
+
|
|
364
|
+
For zoneless testing, you have to provide `provideExperimentalZonelessChangeDetection()` in your `playwright/index.ts`:
|
|
365
|
+
|
|
366
|
+
```ts
|
|
367
|
+
// playwright/index.ts
|
|
368
|
+
import { provideExperimentalZonelessChangeDetection } from '@angular/core';
|
|
369
|
+
import { beforeMount } from '@jscutlery/playwright-ct-angular/hooks';
|
|
370
|
+
|
|
371
|
+
beforeMount(async ({ TestBed }) => {
|
|
372
|
+
TestBed.configureTestingModule({
|
|
373
|
+
providers: [
|
|
374
|
+
provideExperimentalZonelessChangeDetection(),
|
|
375
|
+
],
|
|
376
|
+
});
|
|
377
|
+
});
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
Cf. [Zoneless Example's `playwright/index.ts`](../../tests/playwright-ct-angular-demo/playwright/index.ts)
|
package/package.json
CHANGED
package/register-source.mjs
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import '@angular/compiler';
|
|
2
|
-
import 'zone.js';
|
|
3
1
|
import { Component, reflectComponentType } from '@angular/core';
|
|
4
2
|
import { ComponentFixtureAutoDetect, getTestBed, TestBed, TestComponentRenderer } from '@angular/core/testing';
|
|
5
3
|
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
|