Merge pull request #25876 from csantero/qunit-equiv

[qunit] Add QUnit.equiv
This commit is contained in:
Ron Buckton
2018-05-18 13:16:21 -07:00
committed by GitHub
2 changed files with 14 additions and 0 deletions
+8
View File
@@ -595,6 +595,14 @@ interface QUnit {
*/
todo(name: string, callback?: (assert: Assert) => void): void;
/**
* Compares two values. Returns true if they are equivalent.
*
* @param a The first value
* @param b The second value
*/
equiv<T>(a: T, b: T): boolean;
/**
* Are the test running from the server or not.
*/
+6
View File
@@ -556,3 +556,9 @@ QUnit.test( "test with beforeEach and afterEach", function( assert ) {
QUnit.todo( "a todo test", function( assert ) {
assert.equal( 0, 1, "0 does not equal 1, so this todo should pass" );
});
let equivResult: boolean;
equivResult = QUnit.equiv({}, {});
equivResult = QUnit.equiv(1, 2);
equivResult = QUnit.equiv('foo', 'bar');
equivResult = QUnit.equiv(['foo'], ['bar']);