diff --git a/src/cdk/tsconfig-tests.json b/src/cdk/tsconfig-tests.json index ebdf21c18a1..b4331fcd5fe 100644 --- a/src/cdk/tsconfig-tests.json +++ b/src/cdk/tsconfig-tests.json @@ -11,6 +11,5 @@ }, "include": [ "**/*.spec.ts" - ], - "files": null + ] } diff --git a/src/lib/tsconfig-tests.json b/src/lib/tsconfig-tests.json index 9a7893c5326..61f25f94361 100644 --- a/src/lib/tsconfig-tests.json +++ b/src/lib/tsconfig-tests.json @@ -11,6 +11,5 @@ }, "include": [ "**/*.spec.ts" - ], - "files": null + ] } diff --git a/test/karma-test-shim.js b/test/karma-test-shim.js index 89ff5faf205..472b6a2528d 100644 --- a/test/karma-test-shim.js +++ b/test/karma-test-shim.js @@ -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. diff --git a/test/karma.conf.js b/test/karma.conf.js index 109dfc654e8..9bbc27b4b48 100644 --- a/test/karma.conf.js +++ b/test/karma.conf.js @@ -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, diff --git a/tools/gulp/tasks/unit-test.ts b/tools/gulp/tasks/unit-test.ts index 690f69227c9..19288504e26 100644 --- a/tools/gulp/tasks/unit-test.ts +++ b/tools/gulp/tasks/unit-test.ts @@ -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', )); /** diff --git a/tools/gulp/util/package-tasks.ts b/tools/gulp/util/package-tasks.ts index 224b7d52291..4c351d0c913 100644 --- a/tools/gulp/util/package-tasks.ts +++ b/tools/gulp/util/package-tasks.ts @@ -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. */