-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1411 from typed-ember/blueprint_add_ember-data_mo…
…dules_types feat: install @types/ember-data__* when ember-data is found
- Loading branch information
Showing
3 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import fs from 'fs-extra'; | ||
|
||
const PACKAGE_PATH = 'node_modules/ember-cli-typescript'; | ||
|
||
/** | ||
* We have assorted devDependencies that themselves depend on `ember-cli-typescript`. | ||
* This means we have a published copy of the addon present in `node_modules` normally, | ||
* though `ember-cli-blueprint-test-helpers` fiddles around in there as well. | ||
* | ||
* This helper ensures we move the published version of the addon out of the way into | ||
* an inert location during the enclosing `describe` block and put it back afterwards. | ||
*/ | ||
export function setupPublishedVersionStashing(hooks: Mocha.Suite): void { | ||
hooks.beforeAll(async () => { | ||
await fs.move(PACKAGE_PATH, `${PACKAGE_PATH}.published`); | ||
}); | ||
|
||
hooks.afterAll(async () => { | ||
await fs.move(`${PACKAGE_PATH}.published`, PACKAGE_PATH); | ||
}); | ||
} |