Skip to content

Commit

Permalink
Add tests to confirm that the library definitions aren't broken.
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewstart committed Apr 3, 2020
1 parent 4fe3cbe commit d118d53
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 4 deletions.
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "pixi-animate",
"description": "PIXI plugin for the PixiAnimate Extension",
"version": "2.0.0-rc2",
"version": "2.0.0-rc3",
"main": "lib/pixi-animate.js",
"module": "lib/pixi-animate.es.js",
"bundle": "dist/pixi-animate.js",
Expand Down Expand Up @@ -58,9 +58,11 @@
"build:min:bundle": "terser dist/pixi-animate.js -c -m -o dist/pixi-animate.min.js --source-map \"content='dist/pixi-animate.js.map',includeSources=true,filename='dist/pixi-animate.min.js.map',url='pixi-animate.min.js.map'\" --comments \"/pixi-animate.js - /\"",
"build:min:legacy": "terser dist/pixi-animate-legacy.js -c -m -o dist/pixi-animate-legacy.min.js --source-map \"content='dist/pixi-animate-legacy.js.map',includeSources=true,filename='dist/pixi-animate-legacy.min.js.map',url='pixi-animate-legacy.min.js.map'\" --comments \"/pixi-animate-legacy.js - /\"",
"build:dts": "node scripts/buildAmbientTypes.js",
"test": "floss --path tests/index.js",
"coverage": "nyc npm test",
"test:debug": "npm test -- --debug",
"test": "npm run test:floss && npm run test:tsc",
"test:floss": "floss --path tests/index.js",
"test:tsc": "tsc -p tests/ts-lib/tsconfig.json && tsc -p tests/ts-dist/tsconfig.json",
"coverage": "nyc npm run test:floss && npm run test:tsc",
"test:debug": "npm run test:floss -- --debug",
"docs": "typedoc",
"predocs-live": "npm run docs",
"docs-live": "gh-pages -d docs",
Expand Down
7 changes: 7 additions & 0 deletions tests/ts-dist/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/* eslint-disable @typescript-eslint/triple-slash-reference, spaced-comment */
/// <reference path="../../node_modules/pixi.js/pixi.js.d.ts" />
/// <reference path="../../dist/pixi-animate-ambient.d.ts" />

const clip = new PIXI.animate.MovieClip();

clip.play();
13 changes: 13 additions & 0 deletions tests/ts-dist/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"compilerOptions": {
"target": "ES5",
"module": "commonjs",
"types": ["pixi.js"],
"noEmit": true,
"lib": ["es2015", "dom"],
"declaration": false
},
"include": [
"index.ts"
]
}
5 changes: 5 additions & 0 deletions tests/ts-lib/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var animate = require("../../");
var clip = new animate.MovieClip();
clip.play();
5 changes: 5 additions & 0 deletions tests/ts-lib/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import * as animate from '../../';

const clip = new animate.MovieClip();

clip.play();
13 changes: 13 additions & 0 deletions tests/ts-lib/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"compilerOptions": {
"target": "ES5",
"module": "commonjs",
"types": ["pixi.js"],
"noEmit": true,
"lib": ["es2015", "dom"],
"declaration": false
},
"include": [
"index.ts"
]
}

0 comments on commit d118d53

Please sign in to comment.