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

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

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

JiaLiPassion
Copy link
Collaborator

@JiaLiPassion JiaLiPassion commented May 5, 2018

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. Refactoring test/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 JiaLiPassion force-pushed the rxjs-test branch 15 times, most recently from f478889 to 791ce1a Compare May 8, 2018 18:54
@JiaLiPassion JiaLiPassion force-pushed the rxjs-test branch 2 times, most recently from 9478a81 to 9981118 Compare May 9, 2018 16:25
@JiaLiPassion JiaLiPassion force-pushed the rxjs-test branch 2 times, most recently from 46dab96 to b53ee3f Compare May 10, 2018 02:27
@JiaLiPassion JiaLiPassion changed the title WIP(test): unify mocha/jasmine test WIP(test): unify mocha/jasmine/jest test May 10, 2018
@JiaLiPassion JiaLiPassion force-pushed the rxjs-test branch 7 times, most recently from 37177b4 to 7c4f1aa Compare May 12, 2018 03:43
@JiaLiPassion JiaLiPassion force-pushed the rxjs-test branch 3 times, most recently from d60b1ea to 95e3d88 Compare May 13, 2018 12:12
@JiaLiPassion JiaLiPassion changed the title WIP(test): unify mocha/jasmine/jest test feat(test): unify mocha/jasmine/jest test May 13, 2018
@JiaLiPassion JiaLiPassion changed the title feat(test): unify mocha/jasmine/jest test wIP(test): unify mocha/jasmine/jest test Jun 18, 2018
@JiaLiPassion JiaLiPassion changed the title wIP(test): unify mocha/jasmine/jest test WIP(test): unify mocha/jasmine/jest test Jun 18, 2018
Sign up for free to 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