mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
build: faster building of tests (#4509)
This commit is contained in:
@@ -11,6 +11,5 @@
|
||||
},
|
||||
"include": [
|
||||
"**/*.spec.ts"
|
||||
],
|
||||
"files": null
|
||||
]
|
||||
}
|
||||
|
||||
@@ -11,6 +11,5 @@
|
||||
},
|
||||
"include": [
|
||||
"**/*.spec.ts"
|
||||
],
|
||||
"files": null
|
||||
]
|
||||
}
|
||||
|
||||
@@ -42,8 +42,8 @@ System.config({
|
||||
'node:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic-testing.umd.js',
|
||||
|
||||
// Path mappings for local packages that can be imported inside of tests.
|
||||
'@angular/material': 'dist/bundles/material.umd.js',
|
||||
'@angular/cdk': 'dist/bundles/cdk.umd.js',
|
||||
'@angular/material': 'dist/packages/material/index.js',
|
||||
'@angular/cdk': 'dist/packages/cdk/index.js',
|
||||
},
|
||||
packages: {
|
||||
// Thirdparty barrels.
|
||||
|
||||
@@ -38,7 +38,6 @@ module.exports = (config) => {
|
||||
// Includes all package tests and source files into karma. Those files will be watched.
|
||||
// This pattern also matches all all sourcemap files and TypeScript files for debugging.
|
||||
{pattern: 'dist/packages/**/*', included: false, watched: true},
|
||||
{pattern: 'dist/bundles/*.umd.js', included: false, watched: true},
|
||||
],
|
||||
|
||||
customLaunchers: customLaunchers,
|
||||
|
||||
@@ -9,10 +9,8 @@ const runSequence = require('run-sequence');
|
||||
/** Builds everything that is necessary for karma. */
|
||||
task(':test:build', sequenceTask(
|
||||
'clean',
|
||||
// Build the material bundles without any test files. (CDK will be also built)
|
||||
'material:build',
|
||||
// Additionally build the test files for material and the CDK.
|
||||
['material:build:esm:tests', 'cdk:build:esm:tests']
|
||||
// Build ESM output of Material that also includes all test files.
|
||||
'material:build-tests',
|
||||
));
|
||||
|
||||
/**
|
||||
|
||||
@@ -44,6 +44,15 @@ export function createPackageBuildTasks(packageName: string, requiredPackages: s
|
||||
`${packageName}:build:bundles`,
|
||||
));
|
||||
|
||||
task(`${packageName}:build-tests`, sequenceTask(
|
||||
// Build all required tests before building.
|
||||
...requiredPackages.map(pkgName => `${pkgName}:build-tests`),
|
||||
// Build the ESM output that includes all test files. Also build assets for the package.
|
||||
[`${packageName}:build:esm:tests`, `${packageName}:assets`],
|
||||
// Inline assets into ESM output.
|
||||
`${packageName}:assets:inline`
|
||||
));
|
||||
|
||||
/**
|
||||
* Release tasks for the package. Tasks compose the release output for the package.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user