@@ -10,6 +10,9 @@ const chai = require('ember-cli-blueprint-test-helpers/chai');
1010const expect = chai . expect ;
1111const file = chai . file ;
1212
13+ const td = require ( 'testdouble' ) ;
14+ const MockUI = require ( 'console-ui/mock' ) ;
15+
1316describe ( 'Acceptance: ember generate and destroy ember-cli-template-lint' , function ( ) {
1417 setupTestHooks ( this ) ;
1518
@@ -22,21 +25,32 @@ describe('Acceptance: ember generate and destroy ember-cli-template-lint', funct
2225 delete process . env . FORCE_LOCALIZED_FOR_TESTING ;
2326 } ) ;
2427
28+ let prompt ;
29+ beforeEach ( function ( ) {
30+ prompt = td . function ( ) ;
31+ td . replace ( MockUI . prototype , 'prompt' , prompt ) ;
32+ } ) ;
33+
34+ afterEach ( function ( ) {
35+ td . reset ( ) ;
36+ } ) ;
37+
2538 it ( 'ember-cli-template-lint without localization framework' , co . wrap ( function * ( ) {
26- let args = [ 'ember-cli-template-lint' ] ;
39+ td . when ( prompt ( td . matchers . anything ( ) ) ) . thenResolve ( { answer : 'overwrite' , deleteFiles : 'all' } ) ;
2740
2841 yield emberNew ( ) ;
29- yield emberGenerate ( args ) ;
42+ yield emberGenerate ( [ 'ember-cli-template-lint' ] ) ;
3043
3144 expect ( file ( '.template-lintrc.js' ) ) . to . contain ( 'extends: \'octane\'' ) ;
3245 } ) ) ;
3346
3447 it ( 'ember-cli-template-lint with localization framework' , co . wrap ( function * ( ) {
3548 process . env . FORCE_LOCALIZED_FOR_TESTING = true ;
36- let args = [ 'ember-cli-template-lint' ] ;
49+
50+ td . when ( prompt ( td . matchers . anything ( ) ) ) . thenResolve ( { answer : 'overwrite' , deleteFiles : 'all' } ) ;
3751
3852 yield emberNew ( ) ;
39- yield emberGenerate ( args ) ;
53+ yield emberGenerate ( [ 'ember-cli-template-lint' ] ) ;
4054
4155 expect ( file ( '.template-lintrc.js' ) ) . to . contain ( 'extends: \'octane\'' ) ;
4256 expect ( file ( '.template-lintrc.js' ) ) . to . contain ( '\'no-bare-strings\': true' ) ;
0 commit comments