Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
7f006d3
Tests: Add requirejs text for intern POC
apsdehal Jun 11, 2015
344eba7
Tests: Add intern grunt and config setting
apsdehal Jun 11, 2015
f2a291f
Tests: Modify bootstrap and css js files to return functions
apsdehal Jun 12, 2015
1954384
Tests: Shift intern tests to use intern qunit
apsdehal Jun 12, 2015
1073182
Tests: Add intern dependency
apsdehal Jun 12, 2015
f7b63ea
Tests: Complete the POC by modifying setup and teardown
apsdehal Jun 12, 2015
805c21e
Tests: Deps related changes
apsdehal Jun 13, 2015
9ad657e
Tests: Changes for POC to work
apsdehal Jun 13, 2015
843ba49
Tests: More changes to bring stuff atleast in working condition
apsdehal Jun 17, 2015
e724301
Tests: Remove test swarm stuff
apsdehal Jun 18, 2015
215d254
Tests: Fix some of accordion test
apsdehal Jun 18, 2015
22ea3d4
Tests: Push current structure
apsdehal Jun 25, 2015
08136e9
Tests: Revert back to original bug
apsdehal Jun 25, 2015
bda9302
Tests: New POC
apsdehal Jul 7, 2015
4f92416
Build: Shift qunit-assert-close to apsdehal's fork
apsdehal Jul 8, 2015
6add4f0
Tests: Move to a working POC
apsdehal Jul 8, 2015
251ff75
Tests: Fix issue of intern results
apsdehal Jul 8, 2015
2f75843
Tests: POC works now for accordion/core
apsdehal Jul 8, 2015
a317514
Tests: Extend POC to whole accordion
apsdehal Jul 8, 2015
12c2a23
Tests: Shift QUnit.equiv to assert.deepEqual
apsdehal Jul 8, 2015
e8e5586
Tests: Fix the equalHeight problem with accordion
apsdehal Jul 8, 2015
2d16a6c
Tests: Uncomment handle-click test in core
apsdehal Jul 8, 2015
2aeedac
Tests: Remove autostart command
apsdehal Jul 8, 2015
4e96e8c
Tests: Shift autocomplete to intern
apsdehal Jul 9, 2015
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
Prev Previous commit
Next Next commit
Build: Shift qunit-assert-close to apsdehal's fork
  • Loading branch information
apsdehal committed Jul 8, 2015
commit 4f9241654eca735a304264b02199468a402a498c
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"jshint": "2.4.4",
"qunit": "1.18.0",
"qunit-assert-classes": "1.0.2",
"qunit-assert-close": "JamesMGreene/qunit-assert-close#v1.1.1",
"qunit-assert-close": "apsdehal/qunit-assert-close#amd-patch",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I've pinged @JamesMGreene. Let's make sure to get a new version before landing this.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just released a v2.0.0 version that should meet your needs. Thanks for the ping, @scottgonzalez.

"qunit-composite": "JamesMGreene/qunit-composite#v1.1.0",
"requirejs": "2.1.14",
"requirejs-text": "2.0.14",
Expand Down
214 changes: 107 additions & 107 deletions external/qunit-assert-close/qunit-assert-close.js
Original file line number Diff line number Diff line change
@@ -1,120 +1,120 @@
( function( factory ) {
if ( typeof define === "function" && define.amd ) {
(function (factory) {
if (typeof define === "function" && define.amd) {

// AMD. Register as an anonymous module.
define( [
"qunit"
], factory );
} else {
// AMD. Register as an anonymous module.
define([
"qunit"
], factory);
} else {

// Browser globals
factory( QUnit );
}
}( function( QUnit ) {
/**
* Checks that the first two arguments are equal, or are numbers close enough to be considered equal
* based on a specified maximum allowable difference.
*
* @example assert.close(3.141, Math.PI, 0.001);
*
* @param Number actual
* @param Number expected
* @param Number maxDifference (the maximum inclusive difference allowed between the actual and expected numbers)
* @param String message (optional)
*/
function close(actual, expected, maxDifference, message) {
var actualDiff = (actual === expected) ? 0 : Math.abs(actual - expected),
result = actualDiff <= maxDifference;
message = message || (actual + " should be within " + maxDifference + " (inclusive) of " + expected + (result ? "" : ". Actual: " + actualDiff));
QUnit.push(result, actual, expected, message);
}
// Browser globals
factory(QUnit);
}
}(function (QUnit) {
/**
* Checks that the first two arguments are equal, or are numbers close enough to be considered equal
* based on a specified maximum allowable difference.
*
* @example assert.close(3.141, Math.PI, 0.001);
*
* @param Number actual
* @param Number expected
* @param Number maxDifference (the maximum inclusive difference allowed between the actual and expected numbers)
* @param String message (optional)
*/
function close(actual, expected, maxDifference, message) {
var actualDiff = (actual === expected) ? 0 : Math.abs(actual - expected),
result = actualDiff <= maxDifference;
message = message || (actual + " should be within " + maxDifference + " (inclusive) of " + expected + (result ? "" : ". Actual: " + actualDiff));
QUnit.push(result, actual, expected, message);
}


/**
* Checks that the first two arguments are equal, or are numbers close enough to be considered equal
* based on a specified maximum allowable difference percentage.
*
* @example assert.close.percent(155, 150, 3.4); // Difference is ~3.33%
*
* @param Number actual
* @param Number expected
* @param Number maxPercentDifference (the maximum inclusive difference percentage allowed between the actual and expected numbers)
* @param String message (optional)
*/
close.percent = function closePercent(actual, expected, maxPercentDifference, message) {
var actualDiff, result;
if (actual === expected) {
actualDiff = 0;
result = actualDiff <= maxPercentDifference;
}
else if (actual !== 0 && expected !== 0 && expected !== Infinity && expected !== -Infinity) {
actualDiff = Math.abs(100 * (actual - expected) / expected);
result = actualDiff <= maxPercentDifference;
}
else {
// Dividing by zero (0)! Should return `false` unless the max percentage was `Infinity`
actualDiff = Infinity;
result = maxPercentDifference === Infinity;
}
message = message || (actual + " should be within " + maxPercentDifference + "% (inclusive) of " + expected + (result ? "" : ". Actual: " + actualDiff + "%"));
/**
* Checks that the first two arguments are equal, or are numbers close enough to be considered equal
* based on a specified maximum allowable difference percentage.
*
* @example assert.close.percent(155, 150, 3.4); // Difference is ~3.33%
*
* @param Number actual
* @param Number expected
* @param Number maxPercentDifference (the maximum inclusive difference percentage allowed between the actual and expected numbers)
* @param String message (optional)
*/
close.percent = function closePercent(actual, expected, maxPercentDifference, message) {
var actualDiff, result;
if (actual === expected) {
actualDiff = 0;
result = actualDiff <= maxPercentDifference;
}
else if (actual !== 0 && expected !== 0 && expected !== Infinity && expected !== -Infinity) {
actualDiff = Math.abs(100 * (actual - expected) / expected);
result = actualDiff <= maxPercentDifference;
}
else {
// Dividing by zero (0)! Should return `false` unless the max percentage was `Infinity`
actualDiff = Infinity;
result = maxPercentDifference === Infinity;
}
message = message || (actual + " should be within " + maxPercentDifference + "% (inclusive) of " + expected + (result ? "" : ". Actual: " + actualDiff + "%"));

QUnit.push(result, actual, expected, message);
};
QUnit.push(result, actual, expected, message);
};


/**
* Checks that the first two arguments are numbers with differences greater than the specified
* minimum difference.
*
* @example assert.notClose(3.1, Math.PI, 0.001);
*
* @param Number actual
* @param Number expected
* @param Number minDifference (the minimum exclusive difference allowed between the actual and expected numbers)
* @param String message (optional)
*/
function notClose(actual, expected, minDifference, message) {
var actualDiff = Math.abs(actual - expected),
result = actualDiff > minDifference;
message = message || (actual + " should not be within " + minDifference + " (exclusive) of " + expected + (result ? "" : ". Actual: " + actualDiff));
QUnit.push(result, actual, expected, message);
}
/**
* Checks that the first two arguments are numbers with differences greater than the specified
* minimum difference.
*
* @example assert.notClose(3.1, Math.PI, 0.001);
*
* @param Number actual
* @param Number expected
* @param Number minDifference (the minimum exclusive difference allowed between the actual and expected numbers)
* @param String message (optional)
*/
function notClose(actual, expected, minDifference, message) {
var actualDiff = Math.abs(actual - expected),
result = actualDiff > minDifference;
message = message || (actual + " should not be within " + minDifference + " (exclusive) of " + expected + (result ? "" : ". Actual: " + actualDiff));
QUnit.push(result, actual, expected, message);
}


/**
* Checks that the first two arguments are numbers with differences greater than the specified
* minimum difference percentage.
*
* @example assert.notClose.percent(156, 150, 3.5); // Difference is 4.0%
*
* @param Number actual
* @param Number expected
* @param Number minPercentDifference (the minimum exclusive difference percentage allowed between the actual and expected numbers)
* @param String message (optional)
*/
notClose.percent = function notClosePercent(actual, expected, minPercentDifference, message) {
var actualDiff, result;
if (actual === expected) {
actualDiff = 0;
result = actualDiff > minPercentDifference;
}
else if (actual !== 0 && expected !== 0 && expected !== Infinity && expected !== -Infinity) {
actualDiff = Math.abs(100 * (actual - expected) / expected);
result = actualDiff > minPercentDifference;
}
else {
// Dividing by zero (0)! Should only return `true` if the min percentage was `Infinity`
actualDiff = Infinity;
result = minPercentDifference !== Infinity;
}
message = message || (actual + " should not be within " + minPercentDifference + "% (exclusive) of " + expected + (result ? "" : ". Actual: " + actualDiff + "%"));
/**
* Checks that the first two arguments are numbers with differences greater than the specified
* minimum difference percentage.
*
* @example assert.notClose.percent(156, 150, 3.5); // Difference is 4.0%
*
* @param Number actual
* @param Number expected
* @param Number minPercentDifference (the minimum exclusive difference percentage allowed between the actual and expected numbers)
* @param String message (optional)
*/
notClose.percent = function notClosePercent(actual, expected, minPercentDifference, message) {
var actualDiff, result;
if (actual === expected) {
actualDiff = 0;
result = actualDiff > minPercentDifference;
}
else if (actual !== 0 && expected !== 0 && expected !== Infinity && expected !== -Infinity) {
actualDiff = Math.abs(100 * (actual - expected) / expected);
result = actualDiff > minPercentDifference;
}
else {
// Dividing by zero (0)! Should only return `true` if the min percentage was `Infinity`
actualDiff = Infinity;
result = minPercentDifference !== Infinity;
}
message = message || (actual + " should not be within " + minPercentDifference + "% (exclusive) of " + expected + (result ? "" : ". Actual: " + actualDiff + "%"));

QUnit.push(result, actual, expected, message);
};
QUnit.push(result, actual, expected, message);
};


QUnit.extend(QUnit.assert, {
close: close,
notClose: notClose
});
QUnit.extend(QUnit.assert, {
close: close,
notClose: notClose
});
}));