99 runCommandUntil ,
1010 promisifiedTreeKill ,
1111 killPort ,
12+ stripConsoleColors ,
1213} from '@qwikifiers/e2e/utils' ;
1314
1415export function testApplicationBasicBehavior ( generator : 'app' | 'preset' ) {
@@ -35,9 +36,18 @@ export function testApplicationBasicBehavior(generator: 'app' | 'preset') {
3536 } ) ;
3637
3738 it ( 'should create qwik-nx' , async ( ) => {
38- const result = await runNxCommandAsync ( `build-ssr ${ project } ` ) ;
39+ const result = await runNxCommandAsync ( `build ${ project } ` ) ;
40+ expect ( stripConsoleColors ( result . stdout . replace ( / \n | \s / g, '' ) ) ) . toContain (
41+ [
42+ 'Targets to be executed:' ,
43+ `${ project } :build.client` ,
44+ `${ project } :build.ssr` ,
45+ ]
46+ . join ( '' )
47+ . replace ( / \n | \s / g, '' )
48+ ) ;
3949 expect ( result . stdout ) . toContain (
40- `Successfully ran target build-ssr for project ${ project } `
50+ `Successfully ran target build for project ${ project } `
4151 ) ;
4252 expect ( ( ) =>
4353 checkFilesExist ( `dist/apps/${ project } /client/q-manifest.json` )
@@ -47,6 +57,25 @@ export function testApplicationBasicBehavior(generator: 'app' | 'preset') {
4757 ) . not . toThrow ( ) ;
4858 } , 200000 ) ;
4959
60+ it ( 'should run build with a specified configuration' , async ( ) => {
61+ // TODO: cloudflare pages or custom configurations should also be tested
62+ const result = await runNxCommandAsync (
63+ `build ${ project } --configuration=preview`
64+ ) ;
65+ expect ( stripConsoleColors ( result . stdout . replace ( / \n | \s / g, '' ) ) ) . toContain (
66+ [
67+ 'Targets to be executed:' ,
68+ `${ project } :build.client:preview` ,
69+ `${ project } :build.ssr:preview` ,
70+ ]
71+ . join ( '' )
72+ . replace ( / \n | \s / g, '' )
73+ ) ;
74+ expect ( result . stdout ) . toContain (
75+ `Successfully ran target build for project ${ project } `
76+ ) ;
77+ } , 200000 ) ;
78+
5079 it ( 'should serve application in dev mode with custom port' , async ( ) => {
5180 const port = 4212 ;
5281 const p = await runCommandUntil (
0 commit comments