Skip to content

Export CanvasPattern and CanvasGradient #990

@cmdelatorre

Description

@cmdelatorre

It'd be great if you exported CanvasPattern and CanvasGradient.

I have OpenLayers as a dependency. Internally, it's using CanvasPattern and CanvasGradient. I installed node-canvas for testing: I'm using mocha and jsdom to set a suitable DOM environment for the tests to run. So, in my tests configuration file I have something like:

const canvas = require('canvas');
// ...
global['CanvasRenderingContext2D'] = canvas.Context2d;

Now, some tests that use OpenLayers are failing because it is expecting CanvasPattern and CanvasGradient to be in the global scope.

I can see that you have such classes within your project but they are not public. Or maybe I don't know how to import/use them?

Environment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions