# Code coverage report for modules/__tests__/isDisposable-test.js

## Statements: 100% (20 / 20) Branches: 75% (3 / 4) Functions: 60% (3 / 5) Lines: 100% (19 / 19) Ignored: none

All files » modules/__tests__/ » isDisposable-test.js

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35

    5

    1

    1

    1

    1

    1

    1

    1

    1

    1

    1

    1
    1
    1
    1
    1
    1
    1
    1

     'use strict';

    var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; };

    var _expect = require('expect.js');

    var _expect2 = _interopRequireWildcard(_expect);

    var _Disposable = require('../Disposable');

    var _Disposable2 = _interopRequireWildcard(_Disposable);

    var _SerialDisposable = require('../SerialDisposable');

    var _SerialDisposable2 = _interopRequireWildcard(_SerialDisposable);

    var _CompositeDisposable = require('../CompositeDisposable');

    var _CompositeDisposable2 = _interopRequireWildcard(_CompositeDisposable);

    var _isDisposable = require('../isDisposable');

    var _isDisposable2 = _interopRequireWildcard(_isDisposable);

    describe('isDisposable', function () {
      it('checks for dispose function', function () {
        _expect2['default'](_isDisposable2['default'](new _Disposable2['default']())).to.equal(true);
        _expect2['default'](_isDisposable2['default'](new _SerialDisposable2['default']())).to.equal(true);
        _expect2['default'](_isDisposable2['default'](new _CompositeDisposable2['default']())).to.equal(true);
        _expect2['default'](_isDisposable2['default']({ dispose: function dispose() {} })).to.equal(true);
        _expect2['default'](_isDisposable2['default']({ dispose: 42 })).to.equal(false);
        _expect2['default'](_isDisposable2['default'](function () {})).to.equal(false);
      });
    });
    //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9kYW4vRG9jdW1lbnRzL1Byb2plY3RzL2Rpc3Bvc2FibGVzL21vZHVsZXMvX190ZXN0c19fL2lzRGlzcG9zYWJsZS10ZXN0LmpzIl0sIm5hbWV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