Skip to content

pencil-js/test-environment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Test environment for Pencil.js

This package setup a proper browser environment to test Pencil.js in node.

It's compatible with all existing test-runners (AVA, Jest, Mocha ...)

Installation

npm install --save-dev @pencil.js/test-environment

Usage

Just import the package, it will edit the global scope with required variables.

import "@pencil.js/test-environment";

Or if your test-runner allows it, set it as require dependency in the configuration.

Example

import "@pencil.js/test-environment";
import Pencil from "pencil.js";
import test from "ava";

test("My test", (t) => {
    const scene = new Pencil.Scene();
    t.true(scene.isScene);
});