Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
update(build): deploy angular-material-mocks.js
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasBurleson committed May 11, 2015
1 parent 5defa04 commit 3a256fb
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
3 changes: 3 additions & 0 deletions gulp/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ module.exports = {
'src/**/*.js',
'!src/**/*.spec.js'
],
mockFiles : [
'src/spec/angular-material-mocks.js'
],
themeBaseFiles: [
'src/core/style/variables.scss',
'src/core/style/mixins.scss'
Expand Down
11 changes: 9 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ gulp.task('build-js', function() {
});

gulp.task('build-js-release', function() {
buildJs(true);
return buildJs(true);
});


Expand All @@ -172,7 +172,7 @@ global.buildJs = function buildJs(isRelease) {
.pipe(plumber())
.pipe(ngAnnotate());

return series(jsBuildStream, themeBuildStream())
return series(jsBuildStream, themeBuildStream(), deployMaterialMocks())
.pipe(concat('angular-material.js'))
.pipe(insert.prepend(config.banner))
.pipe(BUILD_MODE.transform())
Expand All @@ -185,6 +185,13 @@ global.buildJs = function buildJs(isRelease) {
));
};


global.deployMaterialMocks = function deployMaterialMocks() {
return gulp.src(config.mockFiles)
.pipe(gulp.dest(config.outputDir));
};


// builds the theming related css and provides it as a JS const for angular
global.themeBuildStream = function themeBuildStream() {
return gulp.src( config.themeBaseFiles.concat(path.join(config.paths, '*-theme.scss')) )
Expand Down
7 changes: 6 additions & 1 deletion src/spec/angular-material-mocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@
*
* Developers interested in running their own custom unit tests WITH angular-material.js loaded...
* must also include this *mocks* file. Similar to `angular-mocks.js`, `angular-material-mocks.js`
* will override and disable specific Angular Material performance settings.
* will override and disable specific Angular Material performance settings:
*
* - Disabled Theme CSS rule generations
* - Forces $mdAria.expectWithText() to be synchronous
* - Mocks $$rAF.throttle()
* - Captures flush exceptions from $$rAF
*
*/
(function(window, angular, undefined) {
Expand Down

0 comments on commit 3a256fb

Please sign in to comment.