@@ -8,7 +8,7 @@ import {afterEach, beforeEach, describe, expect, it, vi} from 'vitest';
8
8
import any from '@travi/any' ;
9
9
import { when } from 'jest-when' ;
10
10
11
- import { scaffold as liftGit , initialize as scaffoldGit } from './vcs/git/git.js' ;
11
+ import { scaffold as scaffoldGit } from './vcs/git/git.js' ;
12
12
import * as licenseScaffolder from './license/scaffolder.js' ;
13
13
import scaffoldLanguage from './language/scaffolder.js' ;
14
14
import * as languagePrompt from './language/prompt.js' ;
@@ -50,7 +50,8 @@ describe('project scaffolder', () => {
50
50
const vcsHosts = any . simpleObject ( ) ;
51
51
const documentation = any . simpleObject ( ) ;
52
52
const vcs = any . simpleObject ( ) ;
53
- const vcsResults = { ...any . simpleObject ( ) , vcs} ;
53
+ const gitNextSteps = any . listOf ( any . simpleObject ) ;
54
+ const vcsResults = { ...any . simpleObject ( ) , vcs, nextSteps : gitNextSteps } ;
54
55
const tags = any . listOf ( any . word ) ;
55
56
const visibility = any . word ( ) ;
56
57
const vcsIgnore = any . simpleObject ( ) ;
@@ -74,7 +75,6 @@ describe('project scaffolder', () => {
74
75
const copyright = { year, holder} ;
75
76
const gitRepoShouldBeInitialized = true ;
76
77
const dependencyUpdaters = any . simpleObject ( ) ;
77
- const gitNextSteps = any . listOf ( any . simpleObject ) ;
78
78
const dependencyUpdaterNextSteps = any . listOf ( any . simpleObject ) ;
79
79
const dependencyUpdaterContributionBadges = any . simpleObject ( ) ;
80
80
const dependencyUpdaterResults = {
@@ -89,7 +89,6 @@ describe('project scaffolder', () => {
89
89
tags
90
90
} ;
91
91
const licenseResults = { badges : { consumer : { license : licenseBadge } } } ;
92
- const gitResults = { nextSteps : gitNextSteps } ;
93
92
const contributingResults = any . simpleObject ( ) ;
94
93
when ( optionsValidator . validate )
95
94
. calledWith ( options )
@@ -111,7 +110,6 @@ describe('project scaffolder', () => {
111
110
when ( scaffoldGit )
112
111
. calledWith ( gitRepoShouldBeInitialized , projectPath , projectName , description , vcsHosts , visibility , decisions )
113
112
. mockResolvedValue ( vcsResults ) ;
114
- liftGit . mockResolvedValue ( gitResults ) ;
115
113
when ( licenseScaffolder . default )
116
114
. calledWith ( { projectRoot : projectPath , license, copyright} )
117
115
. mockResolvedValue ( licenseResults ) ;
@@ -123,7 +121,6 @@ describe('project scaffolder', () => {
123
121
124
122
await scaffold ( options ) ;
125
123
126
- expect ( liftGit ) . toHaveBeenCalledWith ( { projectRoot : projectPath , vcs} ) ;
127
124
expect ( scaffoldReadme ) . toHaveBeenCalledWith ( { projectName, projectRoot : projectPath , description} ) ;
128
125
expect ( dependencyUpdaterScaffolder . default ) . toHaveBeenCalledWith (
129
126
dependencyUpdaters ,
@@ -139,7 +136,7 @@ describe('project scaffolder', () => {
139
136
languageResults ,
140
137
dependencyUpdaterResults ,
141
138
contributingResults ,
142
- gitResults
139
+ vcsResults
143
140
] ) ,
144
141
enhancers : { ...dependencyUpdaters , ...vcsHosts }
145
142
} ) ;
@@ -216,7 +213,6 @@ describe('project scaffolder', () => {
216
213
217
214
await scaffold ( options ) ;
218
215
219
- expect ( liftGit ) . toHaveBeenCalledWith ( { projectRoot : projectPath , vcs} ) ;
220
216
expect ( scaffoldReadme ) . toHaveBeenCalledWith ( { projectName, projectRoot : projectPath , description} ) ;
221
217
} ) ;
222
218
@@ -229,12 +225,10 @@ describe('project scaffolder', () => {
229
225
230
226
await scaffold ( options ) ;
231
227
232
- expect ( liftGit ) . not . toHaveBeenCalled ( ) ;
233
228
expect ( dependencyUpdaterScaffolder . default ) . not . toHaveBeenCalled ( ) ;
234
229
} ) ;
235
230
236
231
it ( 'should scaffold the details of the chosen language plugin' , async ( ) => {
237
- const gitNextSteps = any . listOf ( any . simpleObject ) ;
238
232
const languageConsumerBadges = any . simpleObject ( ) ;
239
233
const languageContributionBadges = any . simpleObject ( ) ;
240
234
const languageStatusBadges = any . simpleObject ( ) ;
@@ -254,12 +248,10 @@ describe('project scaffolder', () => {
254
248
nextSteps : languageNextSteps ,
255
249
tags
256
250
} ;
257
- const gitResults = { nextSteps : gitNextSteps } ;
258
251
when ( optionsValidator . validate )
259
252
. calledWith ( options )
260
253
. mockReturnValue ( { decisions, plugins : { languages, vcsHosts} } ) ;
261
254
scaffoldGit . mockResolvedValue ( vcsResults ) ;
262
- liftGit . mockResolvedValue ( gitResults ) ;
263
255
prompts . promptForBaseDetails . mockResolvedValue ( {
264
256
[ coreQuestionNames . PROJECT_NAME ] : projectName ,
265
257
[ coreQuestionNames . VISIBILITY ] : visibility ,
@@ -285,7 +277,6 @@ describe('project scaffolder', () => {
285
277
286
278
await scaffold ( options ) ;
287
279
288
- expect ( liftGit ) . toHaveBeenCalledWith ( { projectRoot : projectPath , vcs} ) ;
289
280
expect ( scaffoldReadme ) . toHaveBeenCalledWith ( { projectName, projectRoot : projectPath , description} ) ;
290
281
expect ( execaPipe ) . toHaveBeenCalledWith ( process . stdout ) ;
291
282
expect ( resultsReporter . reportResults ) . toHaveBeenCalledWith ( { nextSteps : [ ...languageNextSteps , ...gitNextSteps ] } ) ;
@@ -313,7 +304,6 @@ describe('project scaffolder', () => {
313
304
314
305
await scaffold ( options ) ;
315
306
316
- expect ( liftGit ) . toHaveBeenCalledWith ( { projectRoot : projectPath , vcs} ) ;
317
307
expect ( scaffoldReadme ) . toHaveBeenCalledWith ( { projectName, projectRoot : projectPath , description} ) ;
318
308
expect ( execa ) . not . toHaveBeenCalled ( ) ;
319
309
} ) ;
0 commit comments