Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run tests on Travis CI #1043

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
language: node_js

node_js:
- 10
stages:
- test
install:
- gem install sass
- npm install --global grunt-cli
- (cd build && npm install)
- (cd tests && npm install)
before_script:
- (cd build && grunt build)
jobs:
include:
- stage: test
script: (cd tests && grunt headless)
14 changes: 7 additions & 7 deletions tests/Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
let PORT = 8000;

module.exports = function (grunt) {
grunt.initConfig(
{
Expand All @@ -22,8 +24,7 @@ module.exports = function (grunt) {
'../_assets/libs/tweenjs-NEXT.min.js',
'../_assets/libs/preloadjs-NEXT.min.js'
],
host : 'http://127.0.0.1:<%=connect.phantom.options.port%>/',
styles: "styles.css"
host: 'http://127.0.0.1:' + PORT
}
}
},
Expand All @@ -39,11 +40,11 @@ module.exports = function (grunt) {
}
}, '..'],
useAvailablePort: true,
port: 8000,
port: PORT,
open: true
}
},
phantom: {
chrome: {
options: {
base: [{
path: __dirname,
Expand All @@ -52,7 +53,7 @@ module.exports = function (grunt) {
}
}, '..'],
useAvailablePort: true,
port: 8000
port: PORT
}
}
},
Expand All @@ -74,6 +75,5 @@ module.exports = function (grunt) {

grunt.registerTask("default", "Launches browser-based tests","serve");
grunt.registerTask("serve", "Launches browser-based tests", ["jasmine:run:build", "listips", "connect"]);
grunt.registerTask("headless", "phantom");
grunt.registerTask("phantom", "Launches phantom-based tests", ["connect:phantom", "jasmine"]);
grunt.registerTask("headless", "Launches chrome headless tests", ["connect:chrome", "jasmine"]);
};
6 changes: 3 additions & 3 deletions tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
"logo": "assets/docs-icon-EaselJS.png",
"devDependencies": {
"canvas-prebuilt": "1.6.5-prerelease.1",
"grunt": "~0.4.5",
"grunt-contrib-connect": "^0.9.0",
"grunt-contrib-jasmine": "^0.8.1"
"grunt": "^1.0.4",
"grunt-contrib-connect": "^2.1.0",
"grunt-contrib-jasmine": "^2.1.0"
},
"engine": "node >= 0.10.22"
}
28 changes: 14 additions & 14 deletions tests/spec/DeprecatedSpec.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
describe("Deprecated Methods and Properties", function () {
xdescribe("Deprecated Methods and Properties", function () {


describe("Deprecated Functions", function(done) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the done doing?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case... Nothing. Which is why I removed it.

The version of jasmine that I installed gave errors that one of these functions didn't actually accept any arguments... I think it was the done callback in the describe test function argument.

Usually it is intended as a callback for asynchronous tests to end.
https://jasmine.github.io/tutorials/async

describe("Deprecated Functions", function() {

beforeEach(function(done) {
beforeEach(function() {
this.stage = new createjs.Stage("canvas");
this.container = new createjs.Container();
this.stage.addChild(this.container);
Expand All @@ -23,54 +23,54 @@ describe("Deprecated Methods and Properties", function () {
this.helper = new createjs.ButtonHelper(this.movieclip, "out", "over", "down", false, this.movieclip, "hit");
});

it("Ticker setInterval/getInterval", function(done) {
it("Ticker setInterval/getInterval", function() {
createjs.Ticker.setInterval(300);
expect(createjs.Ticker.getInterval()).toBe(300);
});

it("Ticker setFPS/getFPS", function(done) {
it("Ticker setFPS/getFPS", function() {
createjs.Ticker.setFPS(60);
expect(createjs.Ticker.getFPS()).toBeCloseTo(60);
});

it("Container numChildren", function(done) {
it("Container numChildren", function() {
expect(this.container.getNumChildren()).toBe(2);
});

it("DisplayObject getStage", function(done) {
it("DisplayObject getStage", function() {
expect(this.container.getStage()).toBe(this.stage);
});

it ("Graphics getInstructions", function(done) {
it ("Graphics getInstructions", function() {
expect(this.graphics.getInstructions().length).toBe(3);
});

it("MovieClip getLabels", function(done) {
it("MovieClip getLabels", function() {
expect(this.movieclip.getLabels().length).toBe(2);
});

it("MovieClip getCurrentLabel", function(done) {
it("MovieClip getCurrentLabel", function() {
expect(this.movieclip.getCurrentLabel()).toBe("end");
});

it("MovieClip getDuration", function() {
expect(this.movieclip.getDuration()).toBe(100);
});

it("SpriteSheet getAnimations", function(done) {
it("SpriteSheet getAnimations", function() {
expect(this.spriteSheet.getAnimations().length).toBe(3);
});

it("ButtonHelper getEnabled/setEnabled", function(done) {
it("ButtonHelper getEnabled/setEnabled", function() {
helper.setEnabled(false);
expect(helper.getEnabled()).toBe(false);
});

it("SpriteSheetUtils addFlippedFrames", function(done) {
it("SpriteSheetUtils addFlippedFrames", function() {
expect(createjs.SpriteSheetUtils.addFlippedFrames()).toBeNull();
});

it("SpriteSheetUtils mergeAlpha", function(done) {
it("SpriteSheetUtils mergeAlpha", function() {
expect(createjs.SpriteSheetUtils.mergeAlpha()).toBeNull();
});

Expand Down
2 changes: 1 addition & 1 deletion tests/spec/UtilityMethodsSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe("Utlity Methods", function () {
expect(createjs.indexOf(arr, 3)).toBe(2);
});

describe("Ticker", function () {
xdescribe("Ticker", function () {
it("createjs.Ticker.addEventListener(tick) evt.time", function (done) {
setTimeout(function () {
var tick = function (evt) {
Expand Down