Skip to content
This repository has been archived by the owner on Aug 23, 2021. It is now read-only.

Tests appear to be erroneously passing #24

Closed
dtuite opened this issue Jan 31, 2021 · 2 comments
Closed

Tests appear to be erroneously passing #24

dtuite opened this issue Jan 31, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@dtuite
Copy link
Member

dtuite commented Jan 31, 2021

When the tests run, I see a number of errors logged. However, the build does not fail.

For example, please inspect the yarn run test step of this build.

  ● Console

    console.error
      Error: Not implemented: HTMLCanvasElement.prototype.getContext (without installing the canvas npm package)
          at module.exports (/home/runner/work/backstage-plugin-buildkite/backstage-plugin-buildkite/node_modules/jsdom/lib/jsdom/browser/not-implemented.js:9:17)
          at HTMLCanvasElementImpl.getContext (/home/runner/work/backstage-plugin-buildkite/backstage-plugin-buildkite/node_modules/jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl.js:42:5)
          at HTMLCanvasElement.getContext (/home/runner/work/backstage-plugin-buildkite/backstage-plugin-buildkite/node_modules/jsdom/lib/jsdom/living/generated/HTMLCanvasElement.js:130:58)
          at hasBrowserCanvas (/home/runner/work/backstage-plugin-buildkite/backstage-plugin-buildkite/node_modules/jspdf/src/libs/png.js:480:36)
          at /home/runner/work/backstage-plugin-buildkite/backstage-plugin-buildkite/node_modules/jspdf/src/libs/png.js:489:3
          at Object.<anonymous> (/home/runner/work/backstage-plugin-buildkite/backstage-plugin-buildkite/node_modules/jspdf/src/libs/png.js:28:11)
          at Runtime._execModule (/home/runner/work/backstage-plugin-buildkite/backstage-plugin-buildkite/node_modules/jest-runtime/build/index.js:1299:24)
          at Runtime._loadModule (/home/runner/work/backstage-plugin-buildkite/backstage-plugin-buildkite/node_modules/jest-runtime/build/index.js:898:12)
          at Runtime.requireModule (/home/runner/work/backstage-plugin-buildkite/backstage-plugin-buildkite/node_modules/jest-runtime/build/index.js:746:10)
          at Runtime.requireModuleOrMock (/home/runner/work/backstage-plugin-buildkite/backstage-plugin-buildkite/node_modules/jest-runtime/build/index.js:919:21) undefined

      at VirtualConsole.<anonymous> (../node_modules/jsdom/lib/jsdom/virtual-console.js:29:45)
      at module.exports (../node_modules/jsdom/lib/jsdom/browser/not-implemented.js:12:26)
      at HTMLCanvasElementImpl.getContext (../node_modules/jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl.js:42:5)
      at HTMLCanvasElement.getContext (../node_modules/jsdom/lib/jsdom/living/generated/HTMLCanvasElement.js:130:58)
      at hasBrowserCanvas (../node_modules/jspdf/src/libs/png.js:480:36)
      at ../node_modules/jspdf/src/libs/png.js:489:3
      at Object.<anonymous> (../node_modules/jspdf/src/libs/png.js:28:11)
@dtuite dtuite added the bug Something isn't working label Jan 31, 2021
@mcalus3
Copy link
Contributor

mcalus3 commented Feb 3, 2021

These tests are executing in the testing environment jsdom which emulates most of the browser. It doesn't emulate the canvas element and one of the libraries in the dependency tree (jspdf) checks for that. We can get rid of the errors in two ways:

  • polyfill canvas elements in the testing environment
  • remove the dependency on jspdf somehow

But it's nothing urgent in my opinion

@dtuite
Copy link
Member Author

dtuite commented Feb 3, 2021

@mcalus3 got it. If these tests are actually working then I can close this. Thanks.

@dtuite dtuite closed this as completed Feb 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants