add server testing in node 0.10, 0.12 and iojs #2729

Merged
merged 2 commits into from Aug 23, 2015

Projects

None yet

2 participants

@SergioCrisostomo
Member

CI testing of the server build (closes #2700).

Had to add some xit : it in the specs because they will now run in node environment and document and window are not there.

Added also some Travis optimizing and Safari 8 testing for Browser specs.

To run server specs locally we can use grunt server.

Tested all this in Travis and got green for Browser and node tests.

@arian arian commented on an outdated diff Aug 10, 2015
Specs/Core/Core.js
@@ -610,7 +610,7 @@ describe('instanceOf', function(){
});
// todo(ibolmo)
- if (window.Element && Element.set) it("should return true for Element instances", function(){
+ if (typeof window != 'undefined' && window.Element && Element.set) it("should return true for Element instances", function(){
@arian
arian Aug 10, 2015 Member

do the typeof window check in the dit definition?

@arian arian commented on an outdated diff Aug 10, 2015
Tests/gruntfile-options.js
@@ -21,6 +26,14 @@ var packagerOptions = {
src: ymlPackage.sources,
dest: 'mootools-nocompat.js'
},
+ server: {
@arian
arian Aug 10, 2015 Member

indentation.

@arian arian commented on an outdated diff Aug 10, 2015
"karma-safari-launcher": "~0.1",
- "js-yaml": "^3.0.2"
+ "karma-sauce-launcher": "~0.2.5",
+ "karma-script-launcher": "~0.1.0",
+ "karma-sinon": "~1.0.2",
+ "load-grunt-tasks": "~0.4.0",
+ "requirejs": "~2.1.11"
@arian
arian Aug 10, 2015 Member

Why do we need this?

@arian arian commented on an outdated diff Aug 10, 2015
Tests/gruntfile-options.js
@@ -6,6 +6,11 @@ var ymlPackage = YAML.safeLoad(fs.readFileSync('package.yml', 'utf8'));
var travisBuild = process.env.BUILD;
var travisBrowser = process.env.BROWSER;
var sauceBrowsers = JSON.parse(fs.readFileSync('Tests/browsers.json'));
+var serverBuild = {
+ modules: ['Core/Core', 'Core/Array', 'Core/String', 'Core/Number', 'Core/Function', 'Core/Object', 'Core/Class', 'Core/Class.Extras', 'Core/JSON'],
+ specFiles: ['Specs/Core/*.js', 'Specs/Core/*.js', 'Specs/Core/*.js', 'Specs/Core/*.js', 'Specs/Core/*.js'],
+ strip: ['1.2compat', '1.3compat', '1.4compat', '*compat', 'IE', 'ltIE8', 'ltIE9', '!ES5', '!ES5-bind'/*, '!ES6'*/, 'webkit', 'ltFF4']
@arian
arian Aug 10, 2015 Member

You just defined this in Tests/dist-tasks.json as well...

@SergioCrisostomo
Member

@arian thanks for reviewing.

Updated removing unused requirejs dependency that was there since old days and fixed other things that @arian pointed out.

@SergioCrisostomo SergioCrisostomo added this to the 1.5.2 milestone Aug 15, 2015
@SergioCrisostomo
Member

@arian (or anyone else) can we merge this?

@arian arian commented on the diff Aug 23, 2015
Specs/Core/Core.js
var div = document.createElement('div');
expect(typeOf(div)).toEqual('element');
});
// todo(ibolmo)
- if (window.Elements) it("should return 'elements' for Elements", function(){
+ if (typeof window != 'undefined' && window.Elements) dit("should return 'elements' for Elements", function(){
@arian
arian Aug 23, 2015 Member

isn't this if included in the dit function?

@arian arian commented on the diff Aug 23, 2015
Gruntfile.js
@@ -51,11 +54,21 @@ module.exports = function(grunt) {
var compatBuild = ['clean:specs', 'packager:all', 'packager:specs'];
var nocompatBuild = ['clean:specs', 'packager:nocompat', 'packager:specs-nocompat'];
- var tasks = options.travis.build == 'default' ? compatBuild : nocompatBuild;
- tasks = usePhantom ? tasks.concat('karma:continuous') : tasks.concat('karma:sauceTask');
+ var serverBuild = ['clean:specs', 'packager:server', 'packager:specs-server'];
+
+ var tasks = options.travis.build == 'default' ? compatBuild : options.travis.build == 'server' ? serverBuild : nocompatBuild;
+ tasks = options.travis.build == 'server' ? tasks.concat('server-jasmine-runner') : usePhantom ? tasks.concat('karma:continuous') : tasks.concat('karma:sauceTask');
+
+ // to run only server specs and avoid running browser specs for in the different versions of node and iojs
+ if (options.travis.build && options.travis.build != 'server' && process.version.slice(1, 5) != '0.10') tasks = [];
@arian arian merged commit cb62f08 into mootools:master Aug 23, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@SergioCrisostomo SergioCrisostomo deleted the SergioCrisostomo:server-build-specs branch Dec 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment