UNPKG

node-deadline

Version:

Module to interface with Deadline Compute Management System by Thinkbox Software

31 lines (22 loc) 960 B
/*jshint jasmine: true*/ var utils = require( "../lib/utils/utils" ); describe( "utility functions", function() { it( "should properly parse single items and arrays", function() { var options1 = "single-option", options2 = [ "multiple", "options" ], result1 = utils.parseArrayOption( "propertyName", options1 ), result2 = utils.parseArrayOption( "propertyName", options2 ); expect( result1.propertyName ).toEqual( "single-option" ); expect( result2.$or ).toBeDefined(); expect( result2.$or.length ).toBe( 2 ); expect( result2.$or[ 0 ].propertyName ).toEqual( "multiple" ); expect( result2.$or[ 1 ].propertyName ).toEqual( "options" ); } ); it( "should combine all properties on two objects", function() { var obj1 = { prop1: 1 }, obj2 = { prop2: 2 }, obj3 = utils.combineObjects( obj1, obj2 ); expect( obj3.prop1 ).toBe( 1 ); expect( obj3.prop2 ).toBe( 2 ); } ); } );