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

Expand test setup #105

Merged
merged 30 commits into from
Jul 12, 2020
Merged

Expand test setup #105

merged 30 commits into from
Jul 12, 2020

Conversation

papandreou
Copy link
Collaborator

@papandreou papandreou commented Jul 5, 2020

  • Add fuzz tests based on unexpected-check, css-generators, and html-generators (only runs one iteration by default so it's not too slow)
  • Add some more reference image-based tests for scenarios with unused variants and missing glyphs

And a drive-by:

  • Degrade the missing glyphs warning to "info" status now that we handle it better

TODO:

  • Make sure that the new reference image tests actually would have failed before the latest fixes went in

* master:
  4.0.5
  Update dev dependencies
  Update to assetgraph 6.0.4
  Add missing end paren in status message
  Update font-tracer to ^1.3.1
* master: (64 commits)
  Test in node 14
  Convert mocha config to mocha 8 compatible format
  Update non-breaking development dependencies
  Always include the space character U+20 in subsets to prevent Chrome from downloading the fallback font
  Do not preload unused variants in a self-hosting scenario
  Inject unicode-range into all the @font-face declarations for the given family
  Avoid unhandled promise rejection errors
  5.0.5
  Update assetgraph to ^6.0.8
  Update font-tracer to ^2.0.1
  5.0.4
  Reword the warning slightly
  Test that we don't overwrite an existing unicode-range
  Inject unicode-range into the original @font-face declaration when it's missing glyphs that are used
  Avoid using bluebird
  5.0.3
  Remove lodash.groupby now that we have all of lodash
  Remove unused dependencies
  Fix depdendency
  Do not preload unused variants in the JavaScript-based polyfill
  ...
@papandreou papandreou self-assigned this Jul 5, 2020
@coveralls
Copy link

coveralls commented Jul 5, 2020

Pull Request Test Coverage Report for Build 381

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.006%) to 89.558%

Totals Coverage Status
Change from base Build 372: 0.006%
Covered Lines: 1019
Relevant Lines: 1090

💛 - Coveralls

@papandreou
Copy link
Collaborator Author

Tested that the new tests do catch the errors that were fixed in 5.0.6:

$ git diff 8b1d0a153dbefcbb68f2441adc4aefff4b77ce20..49d5625806e184ad35a6b57f337ee5657506f99c lib | patch -R -p1
patching file lib/subsetFonts.js
$ mocha -g 'reference images with inlineCss:false with inlineFonts:false with omitFallbacks:false with dynamic:false should render missing glyphs'


  reference images
    with inlineCss:false
      with inlineFonts:false
        with omitFallbacks:false
          with dynamic:false
     Error: One or more of the original fonts were loaded:
  https://example.com/OutputSans-Bold.woff2
      at screenshot (test/expect.js:56:13)
      at async Object.handler (test/expect.js:105:31)
  From previous event:
      at Promise._captureStackTrace (node_modules/unexpected-bluebird/js/main/debuggability.js:89:23)
      at oathbreaker (node_modules/unexpected/build/lib/oathbreaker.js:54:11)
      at Function.expectPrototype._executeExpect (node_modules/unexpected/build/lib/createTopLevelExpect.js:1542:10)
      at Function.expectPrototype._expect (node_modules/unexpected/build/lib/createTopLevelExpect.js:1563:23)
      at expect (node_modules/unexpected/build/lib/createTopLevelExpect.js:2033:19)
      at Context.<anonymous> (test/referenceImages.js:37:27)
      at processImmediate (internal/timers.js:456:21)

@papandreou papandreou requested a review from Munter July 6, 2020 19:59
@papandreou
Copy link
Collaborator Author

@Munter, sorry for folding several things into this. I just remembered that I had already refactored the reference image tests in the branch I made for the fuzz tests.

@Munter
Copy link
Owner

Munter commented Jul 12, 2020

This is a great addition :)

@Munter Munter merged commit 0da2646 into master Jul 12, 2020
@Munter Munter deleted the feature/htmlGeneratorTests branch July 12, 2020 13:20
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.

3 participants