Sha256: 9ee220187f701861ec57afb4c8eda358031cf0376745c4a023106c7236f3d346

Contents?: true

Size: 735 Bytes

Versions: 21

Compression:

Stored size: 735 Bytes

Contents

var defined = require('../');
var test = require('tape');

test('defined-or', function (t) {
    var u = undefined;
    
    t.equal(defined(), u, 'empty arguments');
    t.equal(defined(u), u, '1 undefined');
    t.equal(defined(u, u), u, '2 undefined');
    t.equal(defined(u, u, u, u), u, '4 undefineds');
    
    t.equal(defined(undefined, false, true), false, 'false[0]');
    t.equal(defined(false, true), false, 'false[1]');
    t.equal(defined(undefined, 0, true), 0, 'zero[0]');
    t.equal(defined(0, true), 0, 'zero[1]');
    
    t.equal(defined(3, undefined, 4), 3, 'first arg');
    t.equal(defined(undefined, 3, 4), 3, 'second arg');
    t.equal(defined(undefined, undefined, 3), 3, 'third arg');
    
    t.end();
});

Version data entries

21 entries across 21 versions & 10 rubygems

Version Path
boring_generators-0.5.0 tmp/templates/app_template/node_modules/defined/test/def.js
boring_generators-0.4.0 tmp/templates/app_template/node_modules/defined/test/def.js
ilog-0.4.1 node_modules/defined/test/def.js
ilog-0.4.0 node_modules/defined/test/def.js
ilog-0.3.3 node_modules/defined/test/def.js
optimacms-0.4.3 spec/dummy/node_modules/defined/test/def.js
optimacms-0.4.2 spec/dummy/node_modules/defined/test/def.js
locomotivecms-4.0.0.alpha1 app/javascript/node_modules/defined/test/def.js
locomotivecms-3.4.0 app/javascript/node_modules/defined/test/def.js
cortex-0.1.3 spec/dummy/node_modules/defined/test/def.js
lanes-0.8.0 node_modules/defined/test/def.js
xcodebuild-helper-1.2.5 externals/ios-sim-master/node_modules/defined/test/def.js
minimum_viable_product-0.0.11 test/dummy/node_modules/defined/test/def.js
brwy_rails-0.0.6 test/dummy/node_modules/defined/test/def.js
brwy_rails-0.0.5 test/dummy/node_modules/defined/test/def.js
xcodebuild-helper-1.2.3 externals/ios-sim-master/node_modules/defined/test/def.js
brwy_rails-0.0.4 test/dummy/node_modules/defined/test/def.js
brwy_rails-0.0.3 test/dummy/node_modules/defined/test/def.js
brwy_rails-0.0.2 test/dummy/node_modules/defined/test/def.js
brwy_rails-0.0.1 test/dummy/node_modules/defined/test/def.js