(tree)
| 668 | * @param {BroccoliTree} tree |
| 669 | */ |
| 670 | processTests(tree) { |
| 671 | if (this._cachedTests === null) { |
| 672 | let addonTestSupportTree = new Funnel(tree, { |
| 673 | srcDir: 'tests/addon-test-support', |
| 674 | destDir: 'addon-test-support', |
| 675 | }); |
| 676 | |
| 677 | let testTree = new Funnel(tree, { |
| 678 | srcDir: 'tests', |
| 679 | exclude: ['addon-test-support/**/*'], |
| 680 | }); |
| 681 | |
| 682 | let treeToCompile = new Funnel(testTree, { |
| 683 | destDir: `${this.name}/tests`, |
| 684 | annotation: 'Tests To Process', |
| 685 | }); |
| 686 | |
| 687 | treeToCompile = callAddonsPreprocessTreeHook(this.project, 'test', treeToCompile); |
| 688 | |
| 689 | const inputPath = '/tests'; |
| 690 | let preprocessedTests = preprocessJs(treeToCompile, inputPath, this.name, { |
| 691 | registry: this.registry, |
| 692 | treeType: 'test', |
| 693 | }); |
| 694 | |
| 695 | let mergedTestTrees = mergeTrees([addonTestSupportTree, preprocessedTests], { |
| 696 | overwrite: true, |
| 697 | annotation: 'Packaged Tests', |
| 698 | }); |
| 699 | |
| 700 | this._cachedTests = callAddonsPostprocessTreeHook(this.project, 'test', mergedTestTrees); |
| 701 | } |
| 702 | |
| 703 | return this._cachedTests; |
| 704 | } |
| 705 | |
| 706 | /* |
| 707 | * Concatenates all test files into one, as follows: |
no test coverage detected