* Generate the file structure used for the cache-bundle-hosts and enable-cache tests. * Puts it into the usual temporary location defined by ECFP. * * In this fixture, all the addon definitions are to be held in PROJECT/lib, even * though the project itself doesn't directly depend on a few of th
()
| 111 | * @name createStandardCacheFixture |
| 112 | */ |
| 113 | function createStandardCacheFixture() { |
| 114 | let project = new FixturifyProject('test-ember-project', '1.0.0'); |
| 115 | |
| 116 | project.addInRepoAddon('test-addon-a', '1.0.0', { |
| 117 | callback: (addonA) => { |
| 118 | addonA.addInRepoAddon('test-addon-dep', '1.0.0'); |
| 119 | |
| 120 | // At this point, TAD has been run through toJSON inside of TAA. |
| 121 | // TAD itself has no issues. |
| 122 | // in TAA, we want to store all the inrepo addons, at any level, in |
| 123 | // PROJ/lib, so move TAD from TAA and change its path in TAA. |
| 124 | addonA.pkg['ember-addon'].paths = ['../test-addon-dep']; |
| 125 | project.files.lib = project.files.lib || {}; |
| 126 | project.files.lib['test-addon-dep'] = addonA.files.lib['test-addon-dep']; |
| 127 | delete addonA.files.lib; |
| 128 | }, |
| 129 | }); |
| 130 | |
| 131 | project.addInRepoEngine('lazy-engine-a', '1.0.0', { |
| 132 | enableLazyLoading: true, |
| 133 | callback: (lazyEngineA) => { |
| 134 | lazyEngineA.addInRepoAddon('test-engine-dep', '1.0.0'); |
| 135 | |
| 136 | // Similar to above |
| 137 | lazyEngineA.pkg['ember-addon'].paths = ['../test-engine-dep']; |
| 138 | project.files.lib['test-engine-dep'] = lazyEngineA.files.lib['test-engine-dep']; |
| 139 | delete lazyEngineA.files.lib; |
| 140 | }, |
| 141 | }); |
| 142 | |
| 143 | project.addInRepoEngine('lazy-engine-b', '1.0.0', { |
| 144 | enableLazyLoading: true, |
| 145 | callback: (lazyEngineB) => { |
| 146 | // These two addon definitions have already been moved to project, so just |
| 147 | // fix the ember-addon.paths and remove the files.lib entry. |
| 148 | lazyEngineB.pkg['ember-addon'].paths = ['../test-engine-dep', '../test-addon-dep']; |
| 149 | delete lazyEngineB.files.lib; |
| 150 | }, |
| 151 | }); |
| 152 | |
| 153 | project.addInRepoEngine('regular-engine-c', '1.0.0', { |
| 154 | callback: (regularEngineC) => { |
| 155 | regularEngineC.pkg['ember-addon'].paths = ['../test-engine-dep']; |
| 156 | delete regularEngineC.files.lib; |
| 157 | }, |
| 158 | }); |
| 159 | |
| 160 | return project; |
| 161 | } |
| 162 | |
| 163 | /** |
| 164 | * For help with testing, given a bundleHostName and an addon name, return |
no test coverage detected
searching dependent graphs…