@@ -42,11 +42,27 @@ const options = {
4242} satisfies Options ;
4343
4444describe ( "createRerunSuggestion" , ( ) => {
45+ it ( "prints no options when no options are provided" , ( ) => {
46+ const actual = createRerunSuggestion ( { } ) ;
47+
48+ expect ( actual ) . toMatchInlineSnapshot ( `"npx create-typescript-app"` ) ;
49+ } ) ;
50+
51+ it ( "prints only mode when no other options are provided" , ( ) => {
52+ const actual = createRerunSuggestion ( {
53+ mode : "create" ,
54+ } ) ;
55+
56+ expect ( actual ) . toMatchInlineSnapshot (
57+ `"npx create-typescript-app --mode create"` ,
58+ ) ;
59+ } ) ;
60+
4561 it ( "includes key-value pairs with mixed truthy and falsy values" , ( ) => {
4662 const actual = createRerunSuggestion ( options ) ;
4763
4864 expect ( actual ) . toMatchInlineSnapshot (
49- `"npx create-typescript-app --mode create -- base everything --author TestAuthor --description "Test description." --directory . --email-github [email protected] --email-npm [email protected] --exclude-all-contributors --exclude-compliance --exclude-lint-jsdoc --exclude-lint-json --exclude-lint-knip --exclude-lint-package-json --exclude-lint-perfectionist --keywords "abc def ghi jkl mno pqr" --mode create --owner TestOwner --repository test-repository --skip-github-api --skip-install --skip-removal --title "Test Title""` , 65+ `"npx create-typescript-app --base everything --author TestAuthor --description "Test description." --directory . --email-github [email protected] --email-npm [email protected] --exclude-all-contributors --exclude-compliance --exclude-lint-jsdoc --exclude-lint-json --exclude-lint-knip --exclude-lint-package-json --exclude-lint-perfectionist --keywords "abc def ghi jkl mno pqr" --mode create --owner TestOwner --repository test-repository --skip-github-api --skip-install --skip-removal --title "Test Title""` , 5066 ) ;
5167 } ) ;
5268
@@ -57,7 +73,7 @@ describe("createRerunSuggestion", () => {
5773 } ) ;
5874
5975 expect ( actual ) . toMatchInlineSnapshot (
60- `"npx create-typescript-app --mode create -- base everything --access restricted --author TestAuthor --description "Test description." --directory . --email-github [email protected] --email-npm [email protected] --exclude-all-contributors --exclude-compliance --exclude-lint-jsdoc --exclude-lint-json --exclude-lint-knip --exclude-lint-package-json --exclude-lint-perfectionist --keywords "abc def ghi jkl mno pqr" --mode create --owner TestOwner --repository test-repository --skip-github-api --skip-install --skip-removal --title "Test Title""` , 76+ `"npx create-typescript-app --base everything --access restricted --author TestAuthor --description "Test description." --directory . --email-github [email protected] --email-npm [email protected] --exclude-all-contributors --exclude-compliance --exclude-lint-jsdoc --exclude-lint-json --exclude-lint-knip --exclude-lint-package-json --exclude-lint-perfectionist --keywords "abc def ghi jkl mno pqr" --mode create --owner TestOwner --repository test-repository --skip-github-api --skip-install --skip-removal --title "Test Title""` , 6177 ) ;
6278 } ) ;
6379
@@ -72,7 +88,7 @@ describe("createRerunSuggestion", () => {
7288 } ) ;
7389
7490 expect ( actual ) . toMatchInlineSnapshot (
75- `"npx create-typescript-app --mode initialize -- base everything --author TestAuthor --description "Test description." --directory . --email-github [email protected] --email-npm [email protected] --exclude-all-contributors --exclude-compliance --exclude-lint-jsdoc --exclude-lint-json --exclude-lint-knip --exclude-lint-package-json --exclude-lint-perfectionist --guide https://example.com --guide-title "Test Title" --keywords "abc def ghi jkl mno pqr" --mode initialize --owner TestOwner --repository test-repository --skip-github-api --skip-install --skip-removal --title "Test Title""` , 91+ `"npx create-typescript-app --base everything --author TestAuthor --description "Test description." --directory . --email-github [email protected] --email-npm [email protected] --exclude-all-contributors --exclude-compliance --exclude-lint-jsdoc --exclude-lint-json --exclude-lint-knip --exclude-lint-package-json --exclude-lint-perfectionist --guide https://example.com --guide-title "Test Title" --keywords "abc def ghi jkl mno pqr" --mode initialize --owner TestOwner --repository test-repository --skip-github-api --skip-install --skip-removal --title "Test Title""` , 7692 ) ;
7793 } ) ;
7894
@@ -87,7 +103,7 @@ describe("createRerunSuggestion", () => {
87103 } ) ;
88104
89105 expect ( actual ) . toMatchInlineSnapshot (
90- `"npx create-typescript-app --mode initialize -- base everything --author TestAuthor --description "Test description." --directory . --email-github [email protected] --email-npm [email protected] --exclude-all-contributors --exclude-compliance --exclude-lint-jsdoc --exclude-lint-json --exclude-lint-knip --exclude-lint-package-json --exclude-lint-perfectionist --keywords "abc def ghi jkl mno pqr" --logo test/src.png --logo-alt "Test alt." --mode initialize --owner TestOwner --repository test-repository --skip-github-api --skip-install --skip-removal --title "Test Title""` , 106+ `"npx create-typescript-app --base everything --author TestAuthor --description "Test description." --directory . --email-github [email protected] --email-npm [email protected] --exclude-all-contributors --exclude-compliance --exclude-lint-jsdoc --exclude-lint-json --exclude-lint-knip --exclude-lint-package-json --exclude-lint-perfectionist --keywords "abc def ghi jkl mno pqr" --logo test/src.png --logo-alt "Test alt." --mode initialize --owner TestOwner --repository test-repository --skip-github-api --skip-install --skip-removal --title "Test Title""` , 91107 ) ;
92108 } ) ;
93109
@@ -101,7 +117,7 @@ describe("createRerunSuggestion", () => {
101117 } ) ;
102118
103119 expect ( actual ) . toMatchInlineSnapshot (
104- `"npx create-typescript-app --mode initialize -- base everything --author TestAuthor --description "Test description." --directory . --email-github [email protected] --email-npm [email protected] --exclude-all-contributors --exclude-compliance --exclude-lint-jsdoc --exclude-lint-json --exclude-lint-knip --exclude-lint-md --exclude-lint-package-json --exclude-lint-perfectionist --exclude-lint-spelling --keywords "abc def ghi jkl mno pqr" --mode initialize --owner TestOwner --repository test-repository --skip-github-api --skip-install --skip-removal --title "Test Title""` , 120+ `"npx create-typescript-app --base everything --author TestAuthor --description "Test description." --directory . --email-github [email protected] --email-npm [email protected] --exclude-all-contributors --exclude-compliance --exclude-lint-jsdoc --exclude-lint-json --exclude-lint-knip --exclude-lint-md --exclude-lint-package-json --exclude-lint-perfectionist --exclude-lint-spelling --keywords "abc def ghi jkl mno pqr" --mode initialize --owner TestOwner --repository test-repository --skip-github-api --skip-install --skip-removal --title "Test Title""` , 105121 ) ;
106122 } ) ;
107123
@@ -113,7 +129,7 @@ describe("createRerunSuggestion", () => {
113129 } ) ;
114130
115131 expect ( common ) . toMatchInlineSnapshot (
116- `"npx create-typescript-app --mode undefined -- base common"` ,
132+ `"npx create-typescript-app --base common"` ,
117133 ) ;
118134 } ) ;
119135
@@ -125,7 +141,20 @@ describe("createRerunSuggestion", () => {
125141 } ) ;
126142
127143 expect ( minimum ) . toMatchInlineSnapshot (
128- `"npx create-typescript-app --mode undefined --base minimum"` ,
144+ `"npx create-typescript-app --base minimum"` ,
145+ ) ;
146+ } ) ;
147+
148+ it ( "does not list API skip flags when --offline is true" , ( ) => {
149+ const actual = createRerunSuggestion ( {
150+ ...options ,
151+ offline : true ,
152+ skipAllContributorsApi : true ,
153+ skipGitHubApi : true ,
154+ } ) ;
155+
156+ expect ( actual ) . toMatchInlineSnapshot (
157+ `"npx create-typescript-app --base everything --author TestAuthor --description "Test description." --directory . --email-github [email protected] --email-npm [email protected] --exclude-all-contributors --exclude-compliance --exclude-lint-jsdoc --exclude-lint-json --exclude-lint-knip --exclude-lint-package-json --exclude-lint-perfectionist --keywords "abc def ghi jkl mno pqr" --mode create --offline --owner TestOwner --repository test-repository --skip-install --skip-removal --title "Test Title""` , 129158 ) ;
130159 } ) ;
131160} ) ;
0 commit comments