This repository was archived by the owner on Sep 5, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +18
-3
lines changed Expand file tree Collapse file tree 3 files changed +18
-3
lines changed Original file line number Diff line number Diff 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'
Original file line number Diff line number Diff line change @@ -153,7 +153,7 @@ gulp.task('build-js', function() {
153153} ) ;
154154
155155gulp . 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
189196global . themeBuildStream = function themeBuildStream ( ) {
190197 return gulp . src ( config . themeBaseFiles . concat ( path . join ( config . paths , '*-theme.scss' ) ) )
Original file line number Diff line number Diff line change 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 ) {
You can’t perform that action at this time.
0 commit comments