diff --git a/index.js b/index.js index 4b59a07f..2979db4a 100644 --- a/index.js +++ b/index.js @@ -3,6 +3,7 @@ /* eslint-env node */ const VersionChecker = require('ember-cli-version-checker'); +const cacheKeyForTree = require('calculate-cache-key-for-tree'); module.exports = { name: 'ember-test-selectors', @@ -87,6 +88,15 @@ module.exports = { } }, + cacheKeyForTree(treeType) { + // ensure our treeForAddon is memoized + if (treeType === 'addon') { + return cacheKeyForTree('addon', this, [this._stripTestSelectors]); + } else { + return cacheKeyForTree(treeType, this); + } + }, + treeForAddon() { // remove our "addon" folder from the build if we're stripping test selectors if (!this._stripTestSelectors) { diff --git a/package.json b/package.json index 3eedcc28..3817ddbe 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "test:strip": "STRIP_TEST_SELECTORS=true ember test" }, "dependencies": { + "calculate-cache-key-for-tree": "^1.1.0", "ember-cli-babel": "^6.8.2", "ember-cli-version-checker": "^3.0.1" },