Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

WIP(test): unify mocha/jasmine/jest test - #1084

Open
JiaLiPassion wants to merge 11 commits into
angular:masterfrom
JiaLiPassion:rxjs-test
Open

WIP(test): unify mocha/jasmine/jest test#1084
JiaLiPassion wants to merge 11 commits into
angular:masterfrom
JiaLiPassion:rxjs-test

Conversation

@JiaLiPassion

@JiaLiPassionJiaLiPassion commented May 5, 2018

Copy link
Copy Markdown
Collaborator

let zone-testing can handle mocha/jasmine/jest test cases without difference (almost).

  1. when load zone-testing, will auto check if using jasmine or mocha, and zone-testing will load patch accordingly.

  2. Expose async/fakeAsync/tick/flush/discardPeriodicTasks/flushMicrotasks/resetFakeAsyncZone APIs to global, so user can use those APIs directly.

And add clearAllMacrotasks, flushAndDiscardPeriodicTasks helper methods.

  1. add jasmine/jest mapping in Mocha patch, so user can write case in jasmine style and API and can still use Mocha as runner to test.
  • support jasmine expect
  • support jasmine spy
  • support jasmine clock
  • add BDD mapping such as (beforeAll/afterAll/fdescribe/fit/pending...)
  • support jest expect
  • support jest mockFn
  • suport jest TimerMock
  1. Refactoringtest/build/doc folder, current there are too many test/karma/ci file in root folder or in test folder, so re-organize the folder.

  2. Add zone-testing.typing.d.ts, https://github.com/JiaLiPassion/zone.js/blob/26a2b611aa07e71d4af734f620f29a802b61ebc3/lib/testing/zone-testing.typing.ts, it defines all supported jasmine/mocha/jest APIs.

User can still use jasmine or mocha or jest type definition if they don't want to use this zone-testing mix.

Because this zone-testing.typing.d.ts will have conflict (duplicate declaration) with jasmine or mocha or jest type definition, so maybe we should publish this zone-testing.typing.d.ts to @types repo?

@JiaLiPassion
JiaLiPassionforce-pushed the rxjs-test branch 15 times, most recently from f478889 to 791ce1aCompareMay 8, 2018 18:54
@JiaLiPassion
JiaLiPassionforce-pushed the rxjs-test branch 2 times, most recently from 9478a81 to 9981118CompareMay 9, 2018 16:25
@JiaLiPassion
JiaLiPassionforce-pushed the rxjs-test branch 2 times, most recently from 46dab96 to b53ee3fCompareMay 10, 2018 02:27
@JiaLiPassionJiaLiPassion changed the title WIP(test): unify mocha/jasmine testWIP(test): unify mocha/jasmine/jest testMay 10, 2018
@JiaLiPassion
JiaLiPassionforce-pushed the rxjs-test branch 7 times, most recently from 37177b4 to 7c4f1aaCompareMay 12, 2018 03:43
@JiaLiPassion
JiaLiPassionforce-pushed the rxjs-test branch 3 times, most recently from d60b1ea to 95e3d88CompareMay 13, 2018 12:12
@JiaLiPassionJiaLiPassion changed the title WIP(test): unify mocha/jasmine/jest testfeat(test): unify mocha/jasmine/jest testMay 13, 2018
@JiaLiPassionJiaLiPassion changed the title feat(test): unify mocha/jasmine/jest testwIP(test): unify mocha/jasmine/jest testJun 18, 2018
@JiaLiPassionJiaLiPassion changed the title wIP(test): unify mocha/jasmine/jest testWIP(test): unify mocha/jasmine/jest testJun 18, 2018
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@JiaLiPassion@googlebot