Improve the is.observable check

Fixes #72
This commit is contained in:
Sindre Sorhus 2018-12-13 00:49:19 +01:00
parent 9df6f4ebe9
commit e872262ac8
3 changed files with 28 additions and 13 deletions

View file

@ -345,6 +345,14 @@ const types = new Map<string, Test>([
document.createDocumentFragment()
]
}],
['observable', {
is: is.observable,
fixtures: [
new Observable(),
new Subject(),
new ZenObservable(() => {}) // tslint:disable-line:no-empty
]
}],
['nodeStream', {
is: is.nodeStream,
fixtures: [
@ -359,14 +367,6 @@ const types = new Map<string, Test>([
new Stream.Writable()
]
}],
['observable', {
is: is.observable,
fixtures: [
new Observable(),
new Subject(),
new ZenObservable(() => {}) // tslint:disable-line:no-empty
]
}],
['infinite', {
is: is.infinite,
fixtures: [
@ -751,6 +751,10 @@ test('is.domElement', t => {
t.false(is.domElement({nodeType: 1, nodeName: 'div'}));
});
test('is.observable', t => {
testType(t, 'observable');
});
test('is.nodeStream', t => {
testType(t, 'nodeStream');
});