@@ -196,7 +196,6 @@ describe('init', () => {
196
196
expect ( output ) . not . toMatch ( 'warning' ) ;
197
197
expect ( output ) . not . toMatch ( 'Routes' ) ;
198
198
expect ( output ) . toMatch ( / L a n g u a g e : \s * T y p e S c r i p t / ) ;
199
- expect ( output ) . toMatch ( 'Help' ) ;
200
199
expect ( output ) . toMatch ( 'Next steps' ) ;
201
200
expect ( output ) . toMatch (
202
201
// Output contains banner characters. USe [^\w]*? to match them.
@@ -368,7 +367,6 @@ describe('init', () => {
368
367
expect ( output ) . toMatch ( basename ( tmpDir ) ) ;
369
368
expect ( output ) . not . toMatch ( 'Routes' ) ;
370
369
expect ( output ) . toMatch ( / L a n g u a g e : \s * T y p e S c r i p t / ) ;
371
- expect ( output ) . toMatch ( 'Help' ) ;
372
370
expect ( output ) . toMatch ( 'Next steps' ) ;
373
371
expect ( output ) . toMatch (
374
372
// Output contains banner characters. USe [^\w]*? to match them.
@@ -824,5 +822,51 @@ describe('init', () => {
824
822
} ) ;
825
823
} ) ;
826
824
} ) ;
825
+
826
+ describe ( 'Quickstart options' , ( ) => {
827
+ it ( 'Scaffolds Quickstart project with expected values' , async ( ) => {
828
+ await inTemporaryDirectory ( async ( tmpDir ) => {
829
+ await runInit ( {
830
+ path : tmpDir ,
831
+ quickstart : true ,
832
+ installDeps : false ,
833
+ } ) ;
834
+
835
+ const templateFiles = await glob ( '**/*' , {
836
+ cwd : getSkeletonSourceDir ( ) . replace (
837
+ 'skeleton' ,
838
+ 'hydrogen-quickstart' ,
839
+ ) ,
840
+ ignore : [ '**/node_modules/**' , '**/dist/**' ] ,
841
+ } ) ;
842
+ const resultFiles = await glob ( '**/*' , { cwd : tmpDir } ) ;
843
+ const nonAppFiles = templateFiles . filter (
844
+ ( item ) => ! item . startsWith ( 'app/' ) ,
845
+ ) ;
846
+
847
+ expect ( resultFiles ) . toEqual ( expect . arrayContaining ( nonAppFiles ) ) ;
848
+
849
+ expect ( resultFiles ) . toContain ( 'app/root.jsx' ) ;
850
+ expect ( resultFiles ) . toContain ( 'app/entry.client.jsx' ) ;
851
+ expect ( resultFiles ) . toContain ( 'app/entry.server.jsx' ) ;
852
+ expect ( resultFiles ) . toContain ( 'app/components/Layout.jsx' ) ;
853
+ expect ( resultFiles ) . toContain ( 'app/routes/_index.jsx' ) ;
854
+ expect ( resultFiles ) . not . toContain ( 'app/routes/($locale)._index.jsx' ) ;
855
+
856
+ // await expect(readFile(`${tmpDir}/package.json`)).resolves.toMatch(
857
+ // `"name": "hello-world"`,
858
+ // );
859
+
860
+ const output = outputMock . info ( ) ;
861
+ expect ( output ) . not . toMatch ( 'warning' ) ;
862
+ expect ( output ) . toMatch ( 'success' ) ;
863
+ expect ( output ) . toMatch ( / S h o p i f y : \s + M o c k .s h o p / ) ;
864
+ expect ( output ) . toMatch ( / L a n g u a g e : \s + J a v a S c r i p t / ) ;
865
+ expect ( output ) . toMatch ( / S t y l i n g : \s + T a i l w i n d / ) ;
866
+ expect ( output ) . toMatch ( 'Routes' ) ;
867
+ expect ( output ) . toMatch ( 'Next steps' ) ;
868
+ } ) ;
869
+ } ) ;
870
+ } ) ;
827
871
} ) ;
828
872
} ) ;
0 commit comments