MCPcopy Index your code
hub / github.com/ember-cli/ember-cli / packageTestFiles

Method packageTestFiles

lib/broccoli/default-packager.js:936–989  ·  view source on GitHub ↗
(tree, coreTestTree)

Source from the content-addressed store, hash-verified

934 * @return {BroccoliTree}
935 */
936 packageTestFiles(tree, coreTestTree) {
937 let testSupportPath = this.distPaths.testSupportJsFile;
938
939 testSupportPath = testSupportPath.testSupport || testSupportPath;
940
941 let emberCLITree = this.packageEmberCliInternalFiles();
942
943 let headerFiles = [].concat('vendor/ember-cli/test-support-prefix.js', this.legacyTestFilesToAppend);
944
945 let inputFiles = ['addon-test-support/**/*.js'];
946
947 let footerFiles = ['vendor/ember-cli/test-support-suffix.js'];
948
949 let external = this.applyCustomTransforms(tree);
950
951 let baseMergedTree = mergeTrees([emberCLITree, tree, external, coreTestTree], {
952 overwrite: true,
953 });
954 let testJs = concat(baseMergedTree, {
955 headerFiles,
956 inputFiles,
957 footerFiles,
958 outputFile: testSupportPath,
959 annotation: 'Concat: Test Support JS',
960 allowNone: true,
961 sourceMapConfig: this.sourcemaps,
962 });
963
964 let testemPath = path.join(__dirname, 'testem');
965 testemPath = path.dirname(testemPath);
966
967 let testemTree = new Funnel(new UnwatchedDir(testemPath), {
968 files: ['testem.js'],
969 annotation: 'Funnel (testem)',
970 });
971
972 let sourceTrees = [testemTree, testJs];
973
974 if (this.vendorTestStaticStyles.length > 0) {
975 sourceTrees.push(
976 concat(tree, {
977 headerFiles: this.vendorTestStaticStyles,
978 outputFile: this.distPaths.testSupportCssFile,
979 annotation: 'Concat: Test Support CSS',
980 sourceMapConfig: this.sourcemaps,
981 })
982 );
983 }
984
985 return mergeTrees(sourceTrees, {
986 overwrite: true,
987 annotation: 'TreeMerger (testFiles)',
988 });
989 }
990
991 /*
992 * Returns a flattened input tree.

Callers 1

packageTestsMethod · 0.95

Calls 2

applyCustomTransformsMethod · 0.95

Tested by

no test coverage detected