@@ -8,10 +8,10 @@ import { PassThrough } from "stream";
88import { expect , test } from "@oclif/test" ;
99import { cliux , ux , configHandler } from "@contentstack/cli-utilities" ;
1010
11- import config from "../../../src/config" ;
12- import messages from "../../../src/messages" ;
13- import * as mock from "../mock/create .mock.json" ;
14- import manifestData from "../../../src/config/manifest.json" ;
11+ import config from "../../../../ src/config" ;
12+ import messages from "../../../../ src/messages" ;
13+ import * as mock from "../../ mock/common .mock.json" ;
14+ import manifestData from "../../../../ src/config/manifest.json" ;
1515
1616const gitHubHost = "https://github.com" ;
1717const zipPath = join ( process . cwd ( ) , "test" , "unit" , "mock" , "boilerplate.zip" ) ;
@@ -206,9 +206,10 @@ describe("app:create", () => {
206206 . reply ( 200 , { organizations : mock . organizations } )
207207 )
208208 . command ( [ "app:create" , "--data-dir" , process . cwd ( ) ] )
209- . do ( ( { stdout } ) =>
210- expect ( stdout ) . to . contain ( messages . FILE_GENERATION_FAILURE )
211- )
209+ . exit ( 1 )
210+ . do ( ( { stdout } ) => {
211+ expect ( stdout ) . to . includes ( messages . FILE_GENERATION_FAILURE ) ;
212+ } )
212213 . it ( "Boilerplate clone exits with status code 1" ) ;
213214 } ) ;
214215
@@ -236,6 +237,7 @@ describe("app:create", () => {
236237 api . post ( "/manifests" , { ...manifestData , name : "test-app" } ) . reply ( 400 )
237238 )
238239 . command ( [ "app:create" , "--data-dir" , process . cwd ( ) ] )
240+ . exit ( 1 )
239241 . do ( ( { stdout } ) =>
240242 expect ( stdout ) . to . contain ( messages . APP_CREATION_CONSTRAINT_FAILURE )
241243 )
@@ -272,6 +274,7 @@ describe("app:create", () => {
272274 "--config" ,
273275 resolve ( process . cwd ( ) , "test" , "unit" , "mock" , "config.json" ) ,
274276 ] )
277+ . exit ( 1 )
275278 . do ( ( { stdout } ) =>
276279 expect ( stdout ) . to . contain ( messages . APP_CREATION_CONSTRAINT_FAILURE )
277280 )
@@ -320,6 +323,7 @@ describe("app:create", () => {
320323 } )
321324 )
322325 . command ( [ "app:create" , "--data-dir" , process . cwd ( ) ] )
326+ . exit ( 1 )
323327 . do ( ( { stdout } ) =>
324328 expect ( stdout ) . to . contain ( "Dependency installation failed.!" )
325329 )
0 commit comments