diff --git a/package.json b/package.json index 53d3605..28c86fe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "free-range-app-utils", - "version": "0.4.0", + "version": "0.5.0", "description": "Utilities for building free-range apps.", "main": "main.js", "scripts": { diff --git a/src/umdAppConfigBuilder.js b/src/umdAppConfigBuilder.js index 412f703..c4aa75d 100644 --- a/src/umdAppConfigBuilder.js +++ b/src/umdAppConfigBuilder.js @@ -8,12 +8,14 @@ function build(target, opts) { if ( !target ) { throw new Error('Missing target'); } - + + opts = opts || {}; var loader = { schema: "http://apps.d2l.com/uiapps/umdschema/v1.json", - endpoint: target + endpoint: target, + showLoading: opts.showLoading ? true : false }; - + return builder.build( opts, loader ); } diff --git a/test/umdAppConfigBuilder.js b/test/umdAppConfigBuilder.js index de7198c..15839c5 100644 --- a/test/umdAppConfigBuilder.js +++ b/test/umdAppConfigBuilder.js @@ -32,6 +32,15 @@ describe('umdAppConfigBuilder', function(){ it('should have correct endpoint', function(){ builder.build(TARGET, OPTS).loader.should.have.property('endpoint', TARGET ); }); + + it('should have correct property showLoading', function() { + builder.build(TARGET, OPTS).loader.should.have.property('showLoading', true); + + }); + + it('should have property showLoading as false with OPTS undefined', function() { + builder.build(TARGET).loader.should.have.property('showLoading', false); + }); }); }); }); @@ -41,6 +50,7 @@ function createValidOpts() { name: 'some-name', version: '1.0.0.1', description: 'It is a small world', - id: 'some-id' + id: 'some-id', + showLoading: true }; }