Skip to content

Commit cec6506

Browse files
committed
fix(cli): make options test path-agnostic in CI
1 parent f33f8d4 commit cec6506

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

packages/cli/tests/options.test.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
__testClearFrameworks,
66
__testRegisterFramework,
77
} from '@tanstack/create'
8+
import * as create from '@tanstack/create'
89

910
import * as prompts from '../src/ui-prompts'
1011
import * as commandLine from '../src/command-line'
@@ -68,9 +69,24 @@ function setBasicSpies() {
6869
.spyOn(commandLine, 'resolveStarterSpecifier')
6970
.mockImplementation(async (value) =>
7071
value === 'blog'
71-
? '/Users/tannerlinsley/GitHub/cli/examples/react/blog/starter.json'
72+
? 'https://example.com/react/blog/starter.json'
7273
: value,
7374
)
75+
vi.spyOn(create, 'loadStarter').mockImplementation(
76+
async (id) =>
77+
({
78+
id: String(id),
79+
name: 'Blog',
80+
description: 'Blog template',
81+
type: 'starter',
82+
framework: 'react',
83+
mode: 'file-router',
84+
typescript: true,
85+
dependsOn: [],
86+
files: {},
87+
deletedFiles: [],
88+
}) as any,
89+
)
7490
vi.spyOn(prompts, 'getProjectName').mockImplementation(async () => 'hello')
7591
vi.spyOn(prompts, 'selectTemplate').mockImplementation(async () => undefined)
7692
vi.spyOn(prompts, 'selectPackageManager').mockImplementation(

0 commit comments

Comments
 (0)