Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use beforeEach and afterEach instead of initialization code in describe blocks #6905

Closed
timvandermeij opened this issue Jan 21, 2016 · 4 comments

Comments

@timvandermeij
Copy link
Contributor

This might make the unit tests a bit slower (as we might, for example, read one file for each test instead of just once), but it is the recommended way to setup and tear down unit tests properly.

Blocked by #6877.

@Rob--W
Copy link
Member

Rob--W commented Jan 21, 2016

We're currently using Jasmine 1.1.0 (https://github.com/mozilla/pdf.js/tree/58329f7f92f9c9f5dd8a7e42caf6ba3afdd6911d/external/jasmine), which is over 4 years old. Meanwhile Jasmine has improved a lot (in particular in the syntax for asynchronous tests, using explicit callbacks instead of error-prone waitsFor calls), so upgrading to the latest version of Jasmine (and putting the dependency in package.json instead of external/jasmine) might make it easier to enhance the tests.

@yurydelendik
Copy link
Contributor

Jasmine was updated to 2.4.1 by #7129

@yurydelendik
Copy link
Contributor

There is also beforeAll and afterAll, see http://jasmine.github.io/2.4/introduction.html#section-Setup_and_Teardown

@yurydelendik
Copy link
Contributor

TODO:

  • crypto_spec: inside "CipherTransformFactory"
  • dom_utils_spec: inside "isExternalLinkTargetSet"
  • font_spec: inside 'font' (maybe), 'CFFParser',

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants