UNPKG

node-deadline

Version:

Module to interface with Deadline Compute Management System by Thinkbox Software

50 lines (41 loc) 1.16 kB
/*jshint jasmine: true*/ var jobs = require( "../lib/jobs/jobs" ), test = require( "../lib/test/test" ), settings = require( "../lib/settings" ); describe( "job loading and functionality", function() { beforeAll( function() { settings.test = true; //respond to any request with valid obj for extra info parsing test.onRequest = function( db, coll, query, callback ) { if ( coll == "Jobs" ) { callback( null, [ test.responses.job ] ); } else { callback( null, [ test.responses.networkSettings ] ); } }; } ); afterAll( function() { settings.test = false; } ); it( "should properly load a job from the server", function( done ) { jobs.get( {}, function( err, res ) { expect( err ).toBe( null ); expect( res.length ).toBe( 1 ); expect( res[ 0 ] instanceof jobs.Job ).toBe( true ); done(); } ); } ); it( "should properly convert extra info names", function( done ) { jobs.get( {}, function( err, res ) { console.log( res[ 0 ].extraInfo ); done(); } ); } ); } );