-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve the robustness and strictness of the checks (#10)
- Loading branch information
1 parent
ca9746c
commit e02e7f2
Showing
3 changed files
with
26 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import test from 'ava'; | ||
import isObservable from '..'; | ||
|
||
const fake1 = {'@@observable': true}; | ||
const fake2 = {undefined: true}; | ||
const fake3 = { | ||
undefined() { | ||
return this; | ||
} | ||
}; | ||
|
||
test('strict', t => { | ||
// Symbol.observable is defined via AVA | ||
delete Symbol.observable; | ||
// eslint-disable-next-line no-use-extend-native/no-use-extend-native | ||
t.is(Symbol.observable, undefined); | ||
t.false(isObservable(fake1)); | ||
t.false(isObservable(fake2)); | ||
t.false(isObservable(fake3)); | ||
}); |