This repository has been archived by the owner on May 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 305
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(minification): code-split bundles will be minified (#814)
* feat(code-splitting): uglify now minifies all bundles * style(): semicolons * chore(babili): get multiple bundles working with babili * style(imports): remove un-used import * test(uglify): add error path tests) * test(babili): add tests for babili * fix(babili): improve error handling * test(babili): modify error test * chore(babili): make error handling fail correctly * test(babili): more error path tests * fix(uglify): file name is now correct * fix(transpile): file name is now correct * feat(code-splitting): uglify now minifies all bundles * style(): semicolons * chore(babili): get multiple bundles working with babili * style(imports): remove un-used import * test(uglify): add error path tests) * test(babili): add tests for babili * fix(babili): improve error handling * test(babili): modify error test * chore(babili): make error handling fail correctly * test(babili): more error path tests * fix(uglify): file name is now correct * fix(transpile): file name is now correct * style(console): remove un-needed console logs
- Loading branch information
Showing
5 changed files
with
113 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import * as babili from './babili'; | ||
import * as configUtil from './util/config'; | ||
|
||
describe('babili function', () => { | ||
beforeEach(() => { | ||
spyOn(configUtil, 'getUserConfigFile').and.returnValue('fileContents'); | ||
}); | ||
|
||
it('should call main babili function', () => { | ||
const context = { | ||
rootDir: '/Users/justinwillis/Projects/ionic-conference-app' | ||
}; | ||
const configFile = 'configFileContents'; | ||
|
||
return babili.babili(context, configFile).then(() => { | ||
expect(configUtil.getUserConfigFile).toHaveBeenCalledWith(context, babili.taskInfo, configFile); | ||
}); | ||
}); | ||
|
||
it('should throw if context does not have a rootDir', () => { | ||
const context = {}; | ||
const configFile = 'configFileContents'; | ||
|
||
expect(babili.babili(context, configFile)).toThrow(); | ||
}); | ||
|
||
it('should fail because it does not have a valid build context', () => { | ||
const context: null = null; | ||
const configFile = 'configFileContents'; | ||
|
||
expect(babili.babili(context, configFile)).toThrow(); | ||
}); | ||
|
||
it('should fail because it does not have a valid config file', () => { | ||
const context = {}; | ||
const configFile: null = null; | ||
|
||
expect(babili.babili(context, configFile)).toThrow(); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters