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

Commit 3a256fb

Browse files
update(build): deploy angular-material-mocks.js
1 parent 5defa04 commit 3a256fb

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

gulp/config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ module.exports = {
1313
'src/**/*.js',
1414
'!src/**/*.spec.js'
1515
],
16+
mockFiles : [
17+
'src/spec/angular-material-mocks.js'
18+
],
1619
themeBaseFiles: [
1720
'src/core/style/variables.scss',
1821
'src/core/style/mixins.scss'

gulpfile.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ gulp.task('build-js', function() {
153153
});
154154

155155
gulp.task('build-js-release', function() {
156-
buildJs(true);
156+
return buildJs(true);
157157
});
158158

159159

@@ -172,7 +172,7 @@ global.buildJs = function buildJs(isRelease) {
172172
.pipe(plumber())
173173
.pipe(ngAnnotate());
174174

175-
return series(jsBuildStream, themeBuildStream())
175+
return series(jsBuildStream, themeBuildStream(), deployMaterialMocks())
176176
.pipe(concat('angular-material.js'))
177177
.pipe(insert.prepend(config.banner))
178178
.pipe(BUILD_MODE.transform())
@@ -185,6 +185,13 @@ global.buildJs = function buildJs(isRelease) {
185185
));
186186
};
187187

188+
189+
global.deployMaterialMocks = function deployMaterialMocks() {
190+
return gulp.src(config.mockFiles)
191+
.pipe(gulp.dest(config.outputDir));
192+
};
193+
194+
188195
// builds the theming related css and provides it as a JS const for angular
189196
global.themeBuildStream = function themeBuildStream() {
190197
return gulp.src( config.themeBaseFiles.concat(path.join(config.paths, '*-theme.scss')) )

src/spec/angular-material-mocks.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@
44
*
55
* Developers interested in running their own custom unit tests WITH angular-material.js loaded...
66
* must also include this *mocks* file. Similar to `angular-mocks.js`, `angular-material-mocks.js`
7-
* will override and disable specific Angular Material performance settings.
7+
* will override and disable specific Angular Material performance settings:
8+
*
9+
* - Disabled Theme CSS rule generations
10+
* - Forces $mdAria.expectWithText() to be synchronous
11+
* - Mocks $$rAF.throttle()
12+
* - Captures flush exceptions from $$rAF
813
*
914
*/
1015
(function(window, angular, undefined) {

0 commit comments

Comments
 (0)