-
-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'latest' into n4s-endsWith
- Loading branch information
Showing
10 changed files
with
154 additions
and
5 deletions.
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
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,7 @@ | ||
function isNull(value) { | ||
return value === null; | ||
} | ||
|
||
isNull.negativeForm = 'isNotNull'; | ||
|
||
export default isNull; |
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,29 @@ | ||
import isNull from '.'; | ||
|
||
describe('Tests isNull rule', () => { | ||
it('Should return true for `null` value', () => { | ||
expect(isNull(null)).toBe(true); | ||
}); | ||
|
||
it.each([ | ||
undefined, | ||
NaN, | ||
false, | ||
true, | ||
Object, | ||
Array(0), | ||
'', | ||
' ', | ||
0, | ||
1, | ||
'0', | ||
'1', | ||
() => {}, | ||
])('Should return false for %s value', v => { | ||
expect(isNull(v)).toBe(false); | ||
}); | ||
|
||
it('Should expose negativeForm property', () => { | ||
expect(isNull.negativeForm).toBe('isNotNull'); | ||
}); | ||
}); |
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,7 @@ | ||
function isUndefined(value) { | ||
return value === undefined; | ||
} | ||
|
||
isUndefined.negativeForm = 'isNotUndefined'; | ||
|
||
export default isUndefined; |
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,30 @@ | ||
import isUndefined from '.'; | ||
|
||
describe('Tests isUndefined rule', () => { | ||
it('Should return true for `undefined` value', () => { | ||
expect(isUndefined(undefined)).toBe(true); | ||
expect(isUndefined()).toBe(true); | ||
}); | ||
|
||
it.each([ | ||
null, | ||
NaN, | ||
false, | ||
true, | ||
Object, | ||
Array(0), | ||
'', | ||
' ', | ||
0, | ||
1, | ||
'0', | ||
'1', | ||
() => {}, | ||
])('Should return false for %s value', v => { | ||
expect(isUndefined(v)).toBe(false); | ||
}); | ||
|
||
it('Should expose negativeForm property', () => { | ||
expect(isUndefined.negativeForm).toBe('isNotUndefined'); | ||
}); | ||
}); |
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