Skip to content

Commit

Permalink
Merge pull request igorescobar#427 from igorlima/enable-zepto-test
Browse files Browse the repository at this point in the history
Enable Zepto test and also add tests for jQuery 3.0.0
  • Loading branch information
Igor Escobar authored Jun 30, 2016
2 parents 87addf5 + dd4763c commit 08645f2
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ module.exports = function(grunt) {
'http://localhost:9001/test/test-for-jquery-1.8.3.html',
'http://localhost:9001/test/test-for-jquery-1.9.1.html',
'http://localhost:9001/test/test-for-jquery-2.1.1.html',
// 'http://localhost:9001/test/test-for-zepto.html'
'http://localhost:9001/test/test-for-jquery-3.0.0.html',
'http://localhost:9001/test/test-for-zepto.html'
]
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/jquery.mask.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@
*/

/* jshint laxbreak: true */
/* global define, jQuery, Zepto */
/* global define */

'use strict';

// UMD (Universal Module Definition) patterns for JavaScript modules that work everywhere.
// https://github.com/umdjs/umd/blob/master/jqueryPluginCommonjs.js
(function (factory) {
(function (factory, jQuery, Zepto) {

if (typeof define === 'function' && define.amd) {
define(['jquery'], factory);
Expand Down Expand Up @@ -519,4 +519,4 @@
$.applyDataMask();
}
}, globals.watchInterval);
}));
}, window.jQuery, window.Zepto));
35 changes: 35 additions & 0 deletions test/test-for-jquery-3.0.0.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<html>
<head>
<title>jQuery-Mask-Plugin UnitTesting</title>
<link rel="stylesheet" href="http://code.jquery.com/qunit/qunit-1.11.0.css" type="text/css" media="all">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<h1 id="qunit-header">jQuery-Mask-Plugin QUnit Tests</h1>
<h2 id="qunit-banner"></h2>
<div id="qunit-testrunner-toolbar"></div>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests"></ol>
<div id="qunit-fixture">test markup, will be hidden</div>

<!-- testing area -->
<input class="simple-field" type="text" />
<input class="simple-field-data-mask" type="text" data-mask="00/00/0000"/>
<input class="simple-field-data-mask-selectonfocus" type="text" data-mask="00/00/0000" data-mask-selectonfocus="true" />
<input class="simple-field-data-mask-reverse" type="text" data-mask="#.##0,00" data-mask-reverse="true" data-mask-maxlength="false"/>
<input class="simple-field-data-mask-clearifnotmatch" data-mask="000" type="text" data-mask-clearifnotmatch="true" />
<input class="simple-field-data-mask-clearifnotmatch-and-optional-mask" data-mask="009" type="text" data-mask-clearifnotmatch="true" />
<div class="simple-div"></div>
<div id="container-dy-non-inputs"> </div>
<!--/ testing area-->

<script type="text/javascript" src="http://code.jquery.com/jquery-3.0.0.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/qunit/qunit-1.11.0.js"></script>

<script type="text/javascript" src="./sinon-1.10.3.js"></script>
<script type="text/javascript" src="./sinon-qunit-1.0.0.js"></script>

<script type="text/javascript" src="../src/jquery.mask.js"></script>
<script type="text/javascript" src="jquery.mask.test.js"></script>
</body>
</html>
5 changes: 5 additions & 0 deletions test/test-for-zepto.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,21 @@ <h2 id="qunit-userAgent"></h2>
<!-- testing area -->
<input class="simple-field" type="text" />
<input class="simple-field-data-mask" type="text" data-mask="00/00/0000"/>
<input class="simple-field-data-mask-selectonfocus" type="text" data-mask="00/00/0000" data-mask-selectonfocus="true" />
<input class="simple-field-data-mask-reverse" type="text" data-mask="#.##0,00" data-mask-reverse="true" data-mask-maxlength="false"/>
<input class="simple-field-data-mask-clearifnotmatch" data-mask="000" type="text" data-mask-clearifnotmatch="true" />
<input class="simple-field-data-mask-clearifnotmatch-and-optional-mask" data-mask="009" type="text" data-mask-clearifnotmatch="true" />
<div class="simple-div"></div>
<div id="container-dy-non-inputs"> </div>
<!--/ testing area-->

<script type="text/javascript" src="zepto/zepto.min.js"></script>
<script type="text/javascript" src="zepto/data.js"></script>
<script type="text/javascript" src="http://code.jquery.com/qunit/qunit-1.11.0.js"></script>

<script type="text/javascript" src="./sinon-1.10.3.js"></script>
<script type="text/javascript" src="./sinon-qunit-1.0.0.js"></script>

<script type="text/javascript" src="../src/jquery.mask.js"></script>
<script type="text/javascript" src="jquery.mask.test.js"></script>
</body>
Expand Down

0 comments on commit 08645f2

Please sign in to comment.