Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/arcatdmz/createjs-with-jest-and-canvas

A very simple example of using Jest for testing CreateJS-based canvas manipulation results
https://github.com/arcatdmz/createjs-with-jest-and-canvas

canvas createjs easeljs jest

Last synced: about 1 month ago
JSON representation

A very simple example of using Jest for testing CreateJS-based canvas manipulation results

Awesome Lists containing this project

README

        

# createjs-with-jest-and-canvas
A very simple example of using Jest for testing CreateJS-based canvas manipulation results

## install

```sh
$ npm install
```

## test

```sh
$ npm run test

> [email protected] test .\createjs-with-jest-and-canvas
> jest

PASS __tests__/canvas.js
PASS __tests__/createjs.js

Test Suites: 2 passed, 2 total
Tests: 6 passed, 6 total
Snapshots: 0 total
Time: 5.597s
Ran all test suites.
```

## code

- `jest.config.js`: uses `jest-environment-jsdom-with-canvas` as the Jest environment
- `__tests__/canvas.js`: example tests involving raw Canvas APIs
- `__tests__/createjs.js`: example tests involving CreateJS (EaselJS) APIs

## see also

- Jest: https://jestjs.io/
- jest-environment-jsdom-with-canvas: https://github.com/arcatdmz/jest-environment-jsdom-with-canvas

---
https://github.com/arcatdmz/createjs-with-jest-and-canvas