@@ -4,6 +4,7 @@ import tmp from 'tmp-promise';
44let localEmberCli = require . resolve ( 'ember-cli/bin/ember' ) ;
55import { beforeAll , describe , expect , it } from 'vitest' ;
66import { execa } from 'execa' ;
7+ import fixturify from 'fixturify' ;
78
89const blueprintPath = path . join ( __dirname , '../..' ) ;
910
@@ -91,34 +92,42 @@ for (let packageManager of SUPPORTED_PACKAGE_MANAGERS) {
9192 expect ( exitCode ) . toEqual ( 0 ) ;
9293 } ) ;
9394
94- it . skip ( 'build and test ' , async ( ) => {
95- // Copy over fixtures
96- await helper . fixtures . use ( './my-addon/src/components' ) ;
97- await helper . fixtures . use ( './test-app/tests' ) ;
95+ it ( 'build and test' , async ( ) => {
96+ let addonFixture = fixturify . readSync ( './fixtures/addon' ) ;
97+ fixturify . writeSync ( join ( addonDir , 'src' ) , addonFixture ) ;
98+
99+ let testFixture = fixturify . readSync ( './fixtures/rendering-tests' ) ;
100+ fixturify . writeSync ( join ( addonDir , 'tests/rendering' ) , testFixture ) ;
98101
99102 // Ensure that we have no lint errors.
100103 // It's important to keep this along with the tests,
101104 // so that we can have confidence that the lints aren't destructively changing
102105 // the files in a way that would break consumers
103- let { exitCode } = await helper . run ( ' lint:fix' ) ;
106+ let { exitCode } = await execa ( { cwd : addonDir } ) ` ${ packageManager } run lint:fix` ;
104107
105108 expect ( exitCode ) . toEqual ( 0 ) ;
106109
107- let buildResult = await helper . build ( ) ;
110+ let buildResult = await execa ( { cwd : addonDir } ) ` ${ packageManager } run build` ;
108111
109112 expect ( buildResult . exitCode ) . toEqual ( 0 ) ;
110113
111- let contents = await dirContents ( distDir ) ;
114+ let contents = await dirContents ( join ( addonDir , 'dist' ) ) ;
112115
113116 expect ( contents ) . to . deep . equal ( [ '_app_' , 'components' , 'index.js' , 'index.js.map' ] ) ;
114117
115- let testResult = await helper . run ( 'test:ember' ) ;
118+ let testResult = await await execa ( { cwd : addonDir } ) ` ${ packageManager } run test` ;
116119
117120 expect ( testResult . exitCode ) . toEqual ( 0 ) ;
118121
119- expect ( testResult . stdout ) . to . include ( '# tests 4' ) ;
120- expect ( testResult . stdout ) . to . include ( '# pass 4' ) ;
121- expect ( testResult . stdout ) . to . include ( '# fail 0' ) ;
122+ expect ( testResult . stdout ) . includes ( `# tests 2
123+ # pass 2
124+ # skip 0
125+ # todo 0
126+ # fail 0
127+
128+ # ok` , testResult . stdout ) ;
129+
130+
122131 } ) ;
123132 } ) ;
124133}
0 commit comments