-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Tests: POC for intern support using accordion/autocomplete module #1575
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
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 344eba7
Tests: Add intern grunt and config setting
apsdehal f2a291f
Tests: Modify bootstrap and css js files to return functions
apsdehal 1954384
Tests: Shift intern tests to use intern qunit
apsdehal 1073182
Tests: Add intern dependency
apsdehal f7b63ea
Tests: Complete the POC by modifying setup and teardown
apsdehal 805c21e
Tests: Deps related changes
apsdehal 9ad657e
Tests: Changes for POC to work
apsdehal 843ba49
Tests: More changes to bring stuff atleast in working condition
apsdehal e724301
Tests: Remove test swarm stuff
apsdehal 215d254
Tests: Fix some of accordion test
apsdehal 22ea3d4
Tests: Push current structure
apsdehal 08136e9
Tests: Revert back to original bug
apsdehal bda9302
Tests: New POC
apsdehal 4f92416
Build: Shift qunit-assert-close to apsdehal's fork
apsdehal 6add4f0
Tests: Move to a working POC
apsdehal 251ff75
Tests: Fix issue of intern results
apsdehal 2f75843
Tests: POC works now for accordion/core
apsdehal a317514
Tests: Extend POC to whole accordion
apsdehal 12c2a23
Tests: Shift QUnit.equiv to assert.deepEqual
apsdehal e8e5586
Tests: Fix the equalHeight problem with accordion
apsdehal 2d16a6c
Tests: Uncomment handle-click test in core
apsdehal 2aeedac
Tests: Remove autostart command
apsdehal 4e96e8c
Tests: Shift autocomplete to intern
apsdehal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Build: Shift qunit-assert-close to apsdehal's fork
- Loading branch information
commit 4f9241654eca735a304264b02199468a402a498c
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| }); | ||
| })); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.0version that should meet your needs. Thanks for the ping, @scottgonzalez.