MCPcopy Create free account
hub / github.com/ember-cli/ember-cli / treeForAddonTestSupport

Function treeForAddonTestSupport

lib/models/addon.js:896–920  ·  view source on GitHub ↗

Returns the tree for all test files namespaced to a given addon. @public @method treeForAddonTestSupport @param {Tree} tree @return {Tree}

(tree)

Source from the content-addressed store, hash-verified

894 @return {Tree}
895 */
896 treeForAddonTestSupport(tree) {
897 if (!tree) {
898 return tree;
899 }
900
901 let namespacedTree = new Funnel(tree, {
902 srcDir: '/',
903 destDir: `/${this.moduleName()}/test-support`,
904 annotation: `Addon#treeForTestSupport (${this.name})`,
905 });
906
907 if (registryHasPreprocessor(this.registry, 'js')) {
908 return this.preprocessJs(namespacedTree, '/', this.name, {
909 registry: this.registry,
910 treeType: 'addon-test-support',
911 });
912 }
913
914 throw new SilentError(
915 `Addon test-support files were detected in \`${this._treePathFor('addon-test-support')}\`, but no JavaScript ` +
916 `preprocessor was found for \`${this.name}\`. Please make sure to add a preprocessor ` +
917 `(most likely \`ember-cli-babel\`) to \`dependencies\` (NOT \`devDependencies\`) in ` +
918 `\`${this.name}\`'s \`package.json\`.`
919 );
920 },
921
922 /**
923 Runs the styles tree through preprocessors.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…