(tree, coreTestTree)
| 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. |
no test coverage detected