Skip to content

Conversation

@sondreb
Copy link
Owner

@sondreb sondreb commented Feb 11, 2025

Update the Angular unit tests to use Playwright instead of Karma.

  • Modify angular.json to use playwright-ng-schematics:playwright as the test builder and add playwright.config.ts to the test options.
  • Update package.json to remove Karma dependencies and add Playwright dependencies. Change the test script to use playwright test.
  • Modify playwright.config.ts to set testDir to ./src.
  • Update unit test files (src/app/app.component.spec.ts, src/app/pages/about/about.component.spec.ts, src/app/pages/blog/blog.component.spec.ts, src/app/pages/home/home.component.spec.ts, src/app/pages/language-selection/language-selection.component.spec.ts, src/app/pages/learning/learning.component.spec.ts, src/app/pages/privacy/privacy.component.spec.ts, src/app/pages/settings/settings.component.spec.ts, src/app/pages/terms/terms.component.spec.ts) to use Playwright's test and expect functions instead of Angular's testing utilities.

For more details, open the Copilot Workspace session.

Update the Angular unit tests to use Playwright instead of Karma.

* Modify `angular.json` to use `playwright-ng-schematics:playwright` as the test builder and add `playwright.config.ts` to the test options.
* Update `package.json` to remove Karma dependencies and add Playwright dependencies. Change the test script to use `playwright test`.
* Modify `playwright.config.ts` to set `testDir` to `./src`.
* Update unit test files (`src/app/app.component.spec.ts`, `src/app/pages/about/about.component.spec.ts`, `src/app/pages/blog/blog.component.spec.ts`, `src/app/pages/home/home.component.spec.ts`, `src/app/pages/language-selection/language-selection.component.spec.ts`, `src/app/pages/learning/learning.component.spec.ts`, `src/app/pages/privacy/privacy.component.spec.ts`, `src/app/pages/settings/settings.component.spec.ts`, `src/app/pages/terms/terms.component.spec.ts`) to use Playwright's `test` and `expect` functions instead of Angular's testing utilities.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/sondreb/polytalk?shareId=XXXX-XXXX-XXXX-XXXX).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants