Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change umdAppConfigBuilder to not append "app.js" #14

Merged
merged 1 commit into from
Dec 18, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/umdAppConfigBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ function build(target, opts) {

var loader = {
schema: "http://apps.d2l.com/uiapps/umdschema/v1.json",
endpoint: target.charAt(target.length - 1) === '/' ?
target + "app.js" :
target + "/app.js"
endpoint: target
};

return builder.build( opts, loader );
Expand Down
12 changes: 2 additions & 10 deletions test/umdAppConfigBuilder.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
var builder = require('../src/umdAppConfigBuilder');

var TARGET = 'example.com';
var TARGET_WITH_TRAILING_SLASH = 'example.com/path/';
var TARGET = 'example.com/path/app.js';

var OPTS = createValidOpts();

Expand Down Expand Up @@ -31,14 +30,7 @@ describe('umdAppConfigBuilder', function(){
});

it('should have correct endpoint', function(){
builder.build(TARGET, OPTS).loader.should.have.property('endpoint', TARGET + '/app.js' );
});

it('endpoint looks for trailing slashes in target', function(){
builder.build(TARGET_WITH_TRAILING_SLASH, OPTS).loader.should.have.property(
'endpoint',
TARGET_WITH_TRAILING_SLASH + 'app.js'
);
builder.build(TARGET, OPTS).loader.should.have.property('endpoint', TARGET );
});
});
});
Expand Down