Skip to content

Commit d118d53

Browse files
committed
Add tests to confirm that the library definitions aren't broken.
1 parent 4fe3cbe commit d118d53

File tree

6 files changed

+49
-4
lines changed

6 files changed

+49
-4
lines changed

package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "pixi-animate",
33
"description": "PIXI plugin for the PixiAnimate Extension",
4-
"version": "2.0.0-rc2",
4+
"version": "2.0.0-rc3",
55
"main": "lib/pixi-animate.js",
66
"module": "lib/pixi-animate.es.js",
77
"bundle": "dist/pixi-animate.js",
@@ -58,9 +58,11 @@
5858
"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 - /\"",
5959
"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 - /\"",
6060
"build:dts": "node scripts/buildAmbientTypes.js",
61-
"test": "floss --path tests/index.js",
62-
"coverage": "nyc npm test",
63-
"test:debug": "npm test -- --debug",
61+
"test": "npm run test:floss && npm run test:tsc",
62+
"test:floss": "floss --path tests/index.js",
63+
"test:tsc": "tsc -p tests/ts-lib/tsconfig.json && tsc -p tests/ts-dist/tsconfig.json",
64+
"coverage": "nyc npm run test:floss && npm run test:tsc",
65+
"test:debug": "npm run test:floss -- --debug",
6466
"docs": "typedoc",
6567
"predocs-live": "npm run docs",
6668
"docs-live": "gh-pages -d docs",

tests/ts-dist/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/* eslint-disable @typescript-eslint/triple-slash-reference, spaced-comment */
2+
/// <reference path="../../node_modules/pixi.js/pixi.js.d.ts" />
3+
/// <reference path="../../dist/pixi-animate-ambient.d.ts" />
4+
5+
const clip = new PIXI.animate.MovieClip();
6+
7+
clip.play();

tests/ts-dist/tsconfig.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"compilerOptions": {
3+
"target": "ES5",
4+
"module": "commonjs",
5+
"types": ["pixi.js"],
6+
"noEmit": true,
7+
"lib": ["es2015", "dom"],
8+
"declaration": false
9+
},
10+
"include": [
11+
"index.ts"
12+
]
13+
}

tests/ts-lib/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
"use strict";
2+
Object.defineProperty(exports, "__esModule", { value: true });
3+
var animate = require("../../");
4+
var clip = new animate.MovieClip();
5+
clip.play();

tests/ts-lib/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import * as animate from '../../';
2+
3+
const clip = new animate.MovieClip();
4+
5+
clip.play();

tests/ts-lib/tsconfig.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"compilerOptions": {
3+
"target": "ES5",
4+
"module": "commonjs",
5+
"types": ["pixi.js"],
6+
"noEmit": true,
7+
"lib": ["es2015", "dom"],
8+
"declaration": false
9+
},
10+
"include": [
11+
"index.ts"
12+
]
13+
}

0 commit comments

Comments
 (0)