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

Method processTests

lib/broccoli/default-packager.js:670–704  ·  view source on GitHub ↗
(tree)

Source from the content-addressed store, hash-verified

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:

Callers 2

packageTestsMethod · 0.95
tests-test.jsFile · 0.80

Calls 3

preprocessJsFunction · 0.50

Tested by

no test coverage detected