Skip to content
Permalink
Browse files
Build:Tests: Fix custom build tests, verify on Travis; name Travis jobs
This commit fixes unit tests for the following builds:

1. The no-deprecated build: `custom:-deprecated`
2. The current slim build: `custom:-ajax,-effects`
3. The 4.0 (#4553) slim build: `custom:-ajax,-callbacks,-deferred,-effects`

It also adds separate Travis jobs for the no-deprecated & slim builds.

Apart from that, add intuitive names to Travis jobs. Otherwise it's hard to see
at a glance that a particular job is running on Firefox ESR, for example.

Ref gh-4577
Ref gh-4596
Closes gh-4600
  • Loading branch information
mgol committed Jan 27, 2020
1 parent 7a3cf9c commit d525ae3416417186330bb3d14133df84509803a0
Showing 28 changed files with 284 additions and 180 deletions.
@@ -19,3 +19,4 @@ npm-debug.log*
/node_modules

/test/data/core/jquery-iterability-transpiled.js
/test/data/qunit-fixture.js
@@ -9,23 +9,37 @@ env:
- NPM_SCRIPT=test:browserless
matrix:
include:
# Run browser tests only on one Node.js version to save time.
- node_js: "12"
- name: "Browser tests: full build, Chrome & Firefox stable"
node_js: "12"
env:
- NPM_SCRIPT="test:browser"
- BROWSERS="ChromeHeadless,FirefoxHeadless"
addons:
chrome: stable
firefox: latest
# Run AMD tests.
- node_js: "12"
- name: "Browser tests: slim build, Chrome stable"
node_js: "12"
env:
- NPM_SCRIPT="test:slim"
- BROWSERS="ChromeHeadless"
addons:
chrome: stable
- name: "Browser tests: no-deprecated build, Chrome stable"
node_js: "12"
env:
- NPM_SCRIPT="test:no-deprecated"
- BROWSERS="ChromeHeadless"
addons:
chrome: stable
- name: "Browser tests: AMD build, Chrome stable"
node_js: "12"
env:
- NPM_SCRIPT="test:amd"
- BROWSERS="ChromeHeadless"
addons:
chrome: stable
# Run tests on Firefox ESR as well.
- node_js: "12"
- name: "Browser tests: full build, Firefox ESR"
node_js: "12"
env:
- NPM_SCRIPT="test:browser"
- BROWSERS="FirefoxHeadless"
@@ -41,7 +41,7 @@ module.exports = function( grunt ) {
retainLines: true,
plugins: [ "@babel/transform-for-of" ]
},
nodeSmokeTests: {
tests: {
files: {
"test/data/core/jquery-iterability-transpiled.js":
"test/data/core/jquery-iterability-transpiled-es6.js"
@@ -351,7 +351,13 @@ module.exports = function( grunt ) {
"karma:jsdom"
] );

grunt.registerTask( "test:prepare", [
"qunit_fixture",
"babel:tests"
] );

grunt.registerTask( "test", [
"test:prepare",
"test:fast",
"test:slow"
] );
@@ -372,7 +378,7 @@ module.exports = function( grunt ) {
"uglify",
"remove_map_comment",
"dist:*",
"qunit_fixture",
"test:prepare",
"eslint:dist",
"test:fast",
"compare_size"
@@ -4,7 +4,7 @@ module.exports = ( grunt ) => {
const fs = require( "fs" );
const spawnTest = require( "./lib/spawn_test.js" );
const testsDir = "./test/node_smoke_tests/";
const nodeSmokeTests = [ "babel:nodeSmokeTests" ];
const nodeSmokeTests = [];

// Fire up all tests defined in test/node_smoke_tests/*.js in spawned sub-processes.
// All the files under test/node_smoke_tests/*.js are supposed to exit with 0 code
@@ -72,7 +72,9 @@
"test:browserless": "grunt && grunt test:slow",
"test:browser": "grunt && grunt karma:main",
"test:amd": "grunt && grunt karma:amd",
"test": "grunt && grunt test:slow && grunt karma:main && grunt karma:amd",
"test:no-deprecated": "grunt test:prepare && grunt custom:-deprecated && grunt karma:main",
"test:slim": "grunt test:prepare && grunt custom:slim && grunt karma:main",
"test": "npm run test:slim && npm run test:no-deprecated && grunt && grunt test:slow && grunt karma:main && grunt karma:amd",
"jenkins": "npm run test:browserless"
},
"commitplease": {
@@ -8,7 +8,7 @@ define( [
"./ajax/var/rquery",

"./core/init",
"./ajax/parseXML",
"./core/parseXML",
"./event/trigger",
"./deferred",
"./serialize" // jQuery.param
File renamed without changes.
@@ -23,6 +23,8 @@ define( [
"./ajax/script",
"./ajax/jsonp",
"./ajax/load",
"./core/parseXML",
"./core/parseHTML",
"./effects",
"./effects/animatedSelector",
"./offset",
@@ -2,7 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<script src="../../jquery.js"></script>
<script src="../jquery-1.9.1.js"></script>
<script>var $j = jQuery.noConflict();</script>
<script src="../iframeTest.js"></script>
</head>
@@ -18,15 +18,15 @@
<script src="../../jquery.js"></script>
<script src="../iframeTest.js"></script>
<script type="text/javascript" charset="utf-8">
jQuery(function($) {
$(".absolute").click(function() {
$("#marker").css( $(this).offset() );
var pos = $(this).position();
$(this).css({ top: pos.top, left: pos.left });
jQuery( function( $ ) {
$( ".absolute" ).on( "click", function() {
$( "#marker" ).css( $( this ).offset() );
var pos = $( this ).position();
$( this ).css( { top: pos.top, left: pos.left } );
return false;
});
} );
startIframeTest();
});
} );
</script>
</head>
<body>
@@ -12,13 +12,13 @@
<script src="../../jquery.js"></script>
<script src="../iframeTest.js"></script>
<script type="text/javascript" charset="utf-8">
jQuery(function($) {
$("body").click(function() {
$("marker").css( $(this).offset() );
jQuery( function( $ ) {
$( "body" ).on( "click", function() {
$( "#marker" ).css( $( this ).offset() );
return false;
});
} );
startIframeTest();
});
} );
</script>
</head>
<body>
@@ -15,10 +15,10 @@
<script src="../../jquery.js"></script>
<script src="../iframeTest.js"></script>
<script type="text/javascript" charset="utf-8">
jQuery(function($) {
window.scrollTo(1000,1000);
$(".fixed").click(function() {
$("#marker").css( $(this).offset() );
jQuery( function( $ ) {
window.scrollTo( 1000, 1000 );
$( ".fixed" ).on( "click", function() {
$( "#marker" ).css( $( this ).offset() );
return false;
});
startIframeTest();
@@ -14,15 +14,15 @@
<script src="../../jquery.js"></script>
<script src="../iframeTest.js"></script>
<script type="text/javascript" charset="utf-8">
jQuery(function($) {
$(".relative").click(function() {
$("#marker").css( $(this).offset() );
var pos = $(this).position();
$(this).css({ position: 'absolute', top: pos.top, left: pos.left });
jQuery( function( $ ) {
$( ".relative" ).on( "click", function() {
$( "#marker" ).css( $( this ).offset() );
var pos = $( this ).position();
$( this ).css( { position: 'absolute', top: pos.top, left: pos.left } );
return false;
});
} );
startIframeTest();
});
} );
</script>
</head>
<body>
@@ -17,16 +17,16 @@
<script src="../../jquery.js"></script>
<script src="../iframeTest.js"></script>
<script type="text/javascript" charset="utf-8">
jQuery(function($) {
window.scrollTo(1000,1000);
$("#scroll-1")[0].scrollLeft = 5;
$("#scroll-1")[0].scrollTop = 5;
$(".scroll").click(function() {
$("#marker").css( $(this).offset() );
jQuery( function( $ ) {
window.scrollTo( 1000, 1000 );
$( "#scroll-1" )[ 0 ].scrollLeft = 5;
$( "#scroll-1" )[ 0 ].scrollTop = 5;
$( ".scroll" ).on( "click", function() {
$( "#marker" ).css( $( this ).offset() );
return false;
});
} );
startIframeTest();
});
} );
</script>
</head>
<body>
@@ -13,15 +13,15 @@
<script src="../../jquery.js"></script>
<script src="../iframeTest.js"></script>
<script type="text/javascript" charset="utf-8">
jQuery(function($) {
$(".static").click(function() {
$("#marker").css( $(this).offset() );
var pos = $(this).position();
$(this).css({ position: 'absolute', top: pos.top, left: pos.left });
jQuery( function( $ ) {
$( ".static" ).on( "click", function() {
$( "#marker" ).css( $( this ).offset() );
var pos = $( this ).position();
$( this ).css( { position: 'absolute', top: pos.top, left: pos.left } );
return false;
});
} );
startIframeTest();
});
} );
</script>
</head>
<body>
@@ -13,13 +13,13 @@
<script src="../../jquery.js"></script>
<script src="../iframeTest.js"></script>
<script type="text/javascript" charset="utf-8">
jQuery(function($) {
$("table, th, td").click(function() {
$("#marker").css( $(this).offset() );
jQuery( function( $ ) {
$( "table, th, td" ).on( "click", function() {
$( "#marker" ).css( $( this ).offset() );
return false;
});
} );
startIframeTest();
});
} );
</script>
</head>
<body>

This file was deleted.

0 comments on commit d525ae3

Please sign in to comment.