var passes = (actual === expected) || Math.abs(actual - expected) <= maxDifference;
QUnit.push(passes, actual, expected, message);
},
-
+
/**
- * Checks that the first two arguments are numbers with differences greater than the specified
+ * Checks that the first two arguments are numbers with differences greater than the specified
* minimum difference.
*
* @example notClose(3.1, Math.PI, 0.001);
QUnit.addEvent(current, "dblclick", function( e ) {
var target = e && e.target ? e.target : window.event.srcElement;
- if ( target.nodeName.toLowerCase() == "span" || target.nodeName.toLowerCase() == "b" ) {
+ if ( target.nodeName.toLowerCase() === "span" || target.nodeName.toLowerCase() === "b" ) {
target = target.parentNode;
}
if ( window.location && target.nodeName.toLowerCase() === "strong" ) {
});
function XmlWriter(settings) {
- var data = [], stack = [], lineBreakAt;
-
- settings = settings || {};
- lineBreakAt = makeMap(settings.linebreak_at || 'mytag');
-
function addLineBreak(name) {
if (lineBreakAt[name] && data[data.length - 1] !== '\n') {
data.push('\n');
items = items || [];
- if (typeof(items) == "string") {
+ if (typeof(items) === "string") {
items = items.split(',');
}
});
}
+ var data = [], stack = [], lineBreakAt;
+
+ settings = settings || {};
+ lineBreakAt = makeMap(settings.linebreak_at || 'mytag');
+
this.start = function(name, attrs, empty) {
if (!empty) {
stack.push(name);
*/
step: function (expected, message) {
this.config.current.step++; // increment internal step counter.
- if (typeof message == "undefined") {
+ if (typeof message === "undefined") {
message = "step " + expected;
}
var actual = this.config.current.step;
/**
* Reset the step counter for every test()
- */
+ */
QUnit.testStart(function () {
this.config.current.step = 0;
});
</head>
<body>
<div id="qunit"></div>
- <canvas id="qunit-canvas" width="5" height="5"></canvas>
</body>
</html>
}
},
addons: {
- // meh
options: {
+ browser: true,
+ curly: true,
+ eqnull: true,
+ eqeqeq: true,
+ expr: true,
+ evil: true,
+ jquery: true,
+ latedef: true,
+ noarg: true,
onevar: true,
- smarttabs: true
+ smarttabs: true,
+ trailing: true,
+ undef: true
+ },
+ globals: {
+ module: true,
+ test: true,
+ asyncTest: true,
+ expect: true,
+ start: true,
+ stop: true,
+ QUnit: true
}
},
tests: {