-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5551 from Rudraksha20/defaultValueCheckNull
defaultValue check for null
- Loading branch information
Showing
3 changed files
with
22 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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 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 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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/*global defineSuite*/ | ||
defineSuite([ | ||
'Core/defaultValue' | ||
], function( | ||
defaultValue) { | ||
'use strict'; | ||
|
||
it('Works with first parameter undefined', function() { | ||
expect(defaultValue(undefined, 5)).toEqual(5); | ||
}); | ||
|
||
it('Works with first parameter null', function() { | ||
expect(defaultValue(null, 5)).toEqual(5); | ||
}); | ||
|
||
it('Works with first parameter not undefined and not null', function() { | ||
expect(defaultValue(1, 5)).toEqual(1); | ||
}); | ||
|
||
}); |