File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -6,12 +6,15 @@ import helpers from 'ember-cli-blueprint-test-helpers/helpers';
66import chaiHelpers from 'ember-cli-blueprint-test-helpers/chai' ;
77import Blueprint from 'ember-cli/lib/models/blueprint' ;
88
9+ import { setupPublishedVersionStashing } from '../helpers/stash-published-version' ;
910import ects from '../../blueprints/ember-cli-typescript/index' ;
1011
1112const expect = chaiHelpers . expect ;
1213const file = chaiHelpers . file ;
1314
1415describe ( 'Acceptance: ember-cli-typescript generator' , function ( ) {
16+ setupPublishedVersionStashing ( this ) ;
17+
1518 helpers . setupTestHooks ( this , {
1619 disabledTasks : [ 'addon-install' , 'bower-install' ] ,
1720 } ) ;
Original file line number Diff line number Diff line change 1+ import fs from 'fs-extra' ;
2+
3+ const PACKAGE_PATH = 'node_modules/ember-cli-typescript' ;
4+
5+ /**
6+ * We have assorted devDependencies that themselves depend on `ember-cli-typescript`.
7+ * This means we have a published copy of the addon present in `node_modules` normally,
8+ * though `ember-cli-blueprint-test-helpers` fiddles around in there as well.
9+ *
10+ * This helper ensures we move the published version of the addon out of the way into
11+ * an inert location during the enclosing `describe` block and put it back afterwards.
12+ */
13+ export function setupPublishedVersionStashing ( hooks : Mocha . Suite ) : void {
14+ hooks . beforeAll ( async ( ) => {
15+ await fs . move ( PACKAGE_PATH , `${ PACKAGE_PATH } .published` ) ;
16+ } ) ;
17+
18+ hooks . afterAll ( async ( ) => {
19+ await fs . move ( `${ PACKAGE_PATH } .published` , PACKAGE_PATH ) ;
20+ } ) ;
21+ }
You can’t perform that action at this time.
0 commit comments