@tanstack/cli 0.61.1 → 0.62.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/package.json +11 -5
  2. package/skills/CHANGELOG.md +18 -0
  3. package/skills/add-addons-existing-app/SKILL.md +113 -0
  4. package/skills/choose-ecosystem-integrations/SKILL.md +140 -0
  5. package/skills/choose-ecosystem-integrations/references/authentication-providers.md +19 -0
  6. package/skills/choose-ecosystem-integrations/references/data-layer-providers.md +20 -0
  7. package/skills/choose-ecosystem-integrations/references/deployment-targets.md +19 -0
  8. package/skills/create-app-scaffold/SKILL.md +132 -0
  9. package/skills/create-app-scaffold/references/create-flag-compatibility-matrix.md +34 -0
  10. package/skills/create-app-scaffold/references/deployment-providers.md +19 -0
  11. package/skills/create-app-scaffold/references/framework-adapters.md +17 -0
  12. package/skills/create-app-scaffold/references/toolchains.md +17 -0
  13. package/skills/maintain-custom-addons-dev-watch/SKILL.md +118 -0
  14. package/skills/query-docs-library-metadata/SKILL.md +85 -0
  15. package/skills/query-docs-library-metadata/references/discovery-command-output-schemas.md +70 -0
  16. package/CHANGELOG.md +0 -815
  17. package/playwright-report/index.html +0 -85
  18. package/playwright.config.ts +0 -21
  19. package/src/bin.ts +0 -15
  20. package/src/cli.ts +0 -1099
  21. package/src/command-line.ts +0 -612
  22. package/src/dev-watch.ts +0 -564
  23. package/src/discovery.ts +0 -209
  24. package/src/file-syncer.ts +0 -263
  25. package/src/index.ts +0 -21
  26. package/src/options.ts +0 -280
  27. package/src/types.ts +0 -27
  28. package/src/ui-environment.ts +0 -74
  29. package/src/ui-prompts.ts +0 -387
  30. package/src/utils.ts +0 -30
  31. package/test-results/.last-run.json +0 -4
  32. package/tests/command-line.test.ts +0 -703
  33. package/tests/index.test.ts +0 -9
  34. package/tests/options.test.ts +0 -281
  35. package/tests/setupVitest.ts +0 -6
  36. package/tests/ui-environment.test.ts +0 -97
  37. package/tests/ui-prompts.test.ts +0 -233
  38. package/tests-e2e/addons-smoke.spec.ts +0 -31
  39. package/tests-e2e/create-smoke.spec.ts +0 -39
  40. package/tests-e2e/helpers.ts +0 -526
  41. package/tests-e2e/matrix-opportunistic.spec.ts +0 -142
  42. package/tests-e2e/router-only-smoke.spec.ts +0 -54
  43. package/tests-e2e/solid-smoke.spec.ts +0 -26
  44. package/tests-e2e/templates-smoke.spec.ts +0 -52
  45. package/tsconfig.json +0 -17
  46. package/vitest.config.js +0 -8
@@ -1,281 +0,0 @@
1
- import { beforeEach, describe, it, expect, vi } from 'vitest'
2
-
3
- import { promptForCreateOptions } from '../src/options'
4
- import {
5
- __testClearFrameworks,
6
- __testRegisterFramework,
7
- } from '@tanstack/create'
8
- import * as create from '@tanstack/create'
9
-
10
- import * as prompts from '../src/ui-prompts'
11
- import * as commandLine from '../src/command-line'
12
-
13
- import type { Framework } from '@tanstack/create'
14
-
15
- import type { CliOptions } from '../src/types'
16
-
17
- vi.mock('../src/ui-prompts')
18
- vi.mock('../src/command-line')
19
-
20
- beforeEach(() => {
21
- __testClearFrameworks()
22
- __testRegisterFramework({
23
- id: 'react',
24
- name: 'react',
25
- getAddOns: () => [
26
- {
27
- id: 'react-query',
28
- type: 'add-on',
29
- modes: ['file-router'],
30
- },
31
- {
32
- id: 'tanstack-chat',
33
- type: 'add-on',
34
- modes: ['file-router'],
35
- },
36
- {
37
- id: 'biome',
38
- type: 'toolchain',
39
- modes: ['file-router'],
40
- },
41
- ],
42
- supportedModes: {
43
- 'file-router': {
44
- displayName: 'File Router',
45
- description: 'TanStack Start with file-based routing',
46
- forceTypescript: true,
47
- },
48
- },
49
- } as unknown as Framework)
50
-
51
- __testRegisterFramework({
52
- id: 'solid',
53
- name: 'solid',
54
- getAddOns: () => [],
55
- } as unknown as Framework)
56
- })
57
-
58
- const baseCliOptions: CliOptions = {
59
- framework: 'react',
60
- addOns: [],
61
- toolchain: undefined,
62
- projectName: undefined,
63
- git: undefined,
64
- }
65
-
66
- function setBasicSpies() {
67
- vi.spyOn(commandLine, 'listTemplateChoices').mockImplementation(async () => [])
68
- vi
69
- .spyOn(commandLine, 'resolveStarterSpecifier')
70
- .mockImplementation(async (value) =>
71
- value === 'blog'
72
- ? 'https://example.com/react/blog/starter.json'
73
- : value,
74
- )
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
- )
90
- vi.spyOn(prompts, 'getProjectName').mockImplementation(async () => 'hello')
91
- vi.spyOn(prompts, 'selectTemplate').mockImplementation(async () => undefined)
92
- vi.spyOn(prompts, 'selectPackageManager').mockImplementation(
93
- async () => 'npm',
94
- )
95
- vi.spyOn(prompts, 'selectToolchain').mockImplementation(async () => undefined)
96
- vi.spyOn(prompts, 'selectAddOns').mockImplementation(async () => [])
97
- }
98
-
99
- describe('promptForCreateOptions', () => {
100
- //// Project name
101
-
102
- it('prompt for a project name', async () => {
103
- setBasicSpies()
104
-
105
- const options = await promptForCreateOptions(baseCliOptions, {})
106
-
107
- expect(options?.projectName).toBe('hello')
108
- })
109
-
110
- it('accept incoming project name', async () => {
111
- setBasicSpies()
112
-
113
- const options = await promptForCreateOptions(
114
- { ...baseCliOptions, projectName: 'override' },
115
- {},
116
- )
117
-
118
- expect(options?.projectName).toBe('override')
119
- })
120
-
121
- //// Mode is always file-router (TanStack Start)
122
-
123
- it('mode should always be file-router', async () => {
124
- setBasicSpies()
125
-
126
- const options = await promptForCreateOptions(baseCliOptions, {})
127
-
128
- expect(options?.mode).toBe('file-router')
129
- expect(options?.typescript).toBe(true)
130
- })
131
-
132
- //// Tailwind is always enabled
133
-
134
- it('tailwind is always enabled', async () => {
135
- setBasicSpies()
136
- const options = await promptForCreateOptions(baseCliOptions, {})
137
-
138
- expect(options?.tailwind).toBe(true)
139
- })
140
-
141
- it('prompts for templates when none was provided', async () => {
142
- setBasicSpies()
143
- vi.spyOn(commandLine, 'listTemplateChoices').mockImplementation(async () => [
144
- {
145
- id: 'blog',
146
- name: 'Blog',
147
- description: 'Blog template',
148
- framework: 'react',
149
- },
150
- ])
151
-
152
- await promptForCreateOptions(baseCliOptions, {})
153
-
154
- expect(prompts.selectTemplate).toHaveBeenCalledWith([
155
- {
156
- id: 'blog',
157
- name: 'Blog',
158
- description: 'Blog template',
159
- },
160
- ])
161
- })
162
-
163
- it('skips template prompt when template was provided via CLI', async () => {
164
- setBasicSpies()
165
-
166
- await promptForCreateOptions({ ...baseCliOptions, template: 'blog' }, {})
167
-
168
- expect(prompts.selectTemplate).not.toHaveBeenCalled()
169
- })
170
-
171
- it('skips template prompt in router-only mode', async () => {
172
- setBasicSpies()
173
-
174
- await promptForCreateOptions({ ...baseCliOptions, routerOnly: true }, {})
175
-
176
- expect(prompts.selectTemplate).not.toHaveBeenCalled()
177
- })
178
-
179
- //// Package manager
180
-
181
- it('uses the package manager from the cli options', async () => {
182
- setBasicSpies()
183
-
184
- const options = await promptForCreateOptions(
185
- { ...baseCliOptions, packageManager: 'bun' },
186
- {},
187
- )
188
-
189
- expect(options?.packageManager).toBe('bun')
190
- })
191
-
192
- it('detects package manager from environment', async () => {
193
- setBasicSpies()
194
-
195
- process.env.npm_config_userconfig = 'blarg'
196
-
197
- const options = await promptForCreateOptions(
198
- { ...baseCliOptions, packageManager: undefined },
199
- {},
200
- )
201
-
202
- expect(options?.packageManager).toBe('pnpm')
203
- })
204
-
205
- //// Add-ons
206
- it('should be clean when no add-ons are selected', async () => {
207
- setBasicSpies()
208
-
209
- const options = await promptForCreateOptions({ ...baseCliOptions }, {})
210
-
211
- expect(options?.chosenAddOns).toEqual([])
212
- })
213
-
214
- it('should select biome when toolchain is specified', async () => {
215
- setBasicSpies()
216
-
217
- vi.spyOn(prompts, 'selectToolchain').mockImplementation(async () => 'biome')
218
-
219
- const options = await promptForCreateOptions(
220
- { ...baseCliOptions, toolchain: 'biome' },
221
- {},
222
- )
223
-
224
- expect(options?.chosenAddOns.map((a) => a.id).sort()).toEqual(['biome'])
225
- })
226
-
227
- it('should handle forced add-ons', async () => {
228
- setBasicSpies()
229
-
230
- vi.spyOn(prompts, 'selectToolchain').mockImplementation(
231
- async () => undefined,
232
- )
233
-
234
- const options = await promptForCreateOptions(
235
- { ...baseCliOptions },
236
- { forcedAddOns: ['react-query'] },
237
- )
238
-
239
- expect(options?.chosenAddOns.map((a) => a.id).sort()).toEqual([
240
- 'react-query',
241
- ])
242
- expect(options?.tailwind).toBe(true)
243
- expect(options?.typescript).toBe(true)
244
- })
245
-
246
- it('should handle add-ons from the CLI', async () => {
247
- setBasicSpies()
248
-
249
- const options = await promptForCreateOptions(
250
- { ...baseCliOptions, addOns: ['biome', 'react-query'] },
251
- {},
252
- )
253
-
254
- expect(options?.chosenAddOns.map((a) => a.id).sort()).toEqual([
255
- 'biome',
256
- 'react-query',
257
- ])
258
- expect(options?.tailwind).toBe(true)
259
- expect(options?.typescript).toBe(true)
260
- })
261
-
262
- it('should handle user-selected add-ons', async () => {
263
- setBasicSpies()
264
-
265
- vi.spyOn(prompts, 'selectAddOns').mockImplementation(async () =>
266
- Promise.resolve(['biome', 'react-query']),
267
- )
268
-
269
- const options = await promptForCreateOptions(
270
- { ...baseCliOptions, addOns: undefined },
271
- {},
272
- )
273
-
274
- expect(options?.chosenAddOns.map((a) => a.id).sort()).toEqual([
275
- 'biome',
276
- 'react-query',
277
- ])
278
- expect(options?.tailwind).toBe(true)
279
- expect(options?.typescript).toBe(true)
280
- })
281
- })
@@ -1,6 +0,0 @@
1
- import createFetchMock from 'vitest-fetch-mock'
2
- import { vi } from 'vitest'
3
-
4
- const fetchMocker = createFetchMock(vi)
5
-
6
- fetchMocker.enableMocks()
@@ -1,97 +0,0 @@
1
- import { describe, it, expect, vi } from 'vitest'
2
-
3
- import * as clack from '@clack/prompts'
4
-
5
- import { createUIEnvironment } from '../src/ui-environment.js'
6
-
7
- vi.mock('@clack/prompts')
8
-
9
- // @ts-expect-error
10
- vi.spyOn(process, 'exit').mockImplementation(() => {})
11
-
12
- describe('createUIEnvironment', () => {
13
- it('should create a silent UI environment', () => {
14
- const environment = createUIEnvironment('test', true)
15
- expect(environment.appName).toBe('test')
16
- })
17
-
18
- it('should handle intro', () => {
19
- const environment = createUIEnvironment('test', false)
20
- const spy = vi
21
- .spyOn(clack, 'intro')
22
- .mockImplementation(async () => undefined)
23
- environment.intro('test')
24
- expect(spy).toHaveBeenCalledWith('test')
25
- })
26
-
27
- it('should handle outro', () => {
28
- const environment = createUIEnvironment('test', false)
29
- const spy = vi
30
- .spyOn(clack, 'outro')
31
- .mockImplementation(async () => undefined)
32
- environment.outro('test')
33
- expect(spy).toHaveBeenCalledWith('test')
34
- })
35
-
36
- it('should handle info', () => {
37
- const environment = createUIEnvironment('test', false)
38
- const spy = vi
39
- .spyOn(clack.log, 'info')
40
- .mockImplementation(async () => undefined)
41
- environment.info('test')
42
- expect(spy).toHaveBeenCalled()
43
- })
44
-
45
- it('should handle error', () => {
46
- const environment = createUIEnvironment('test', false)
47
- const spy = vi
48
- .spyOn(clack.log, 'error')
49
- .mockImplementation(async () => undefined)
50
- environment.error('test')
51
- expect(spy).toHaveBeenCalled()
52
- })
53
-
54
- it('should handle warn', () => {
55
- const environment = createUIEnvironment('test', false)
56
- const spy = vi
57
- .spyOn(clack.log, 'warn')
58
- .mockImplementation(async () => undefined)
59
- environment.warn('test')
60
- expect(spy).toHaveBeenCalled()
61
- })
62
-
63
- it('should handle confirm', async () => {
64
- const environment = createUIEnvironment('test', false)
65
- const spy = vi.spyOn(clack, 'confirm').mockImplementation(async () => true)
66
- const isCancelSpy = vi
67
- .spyOn(clack, 'isCancel')
68
- .mockImplementation(() => false)
69
- const result = await environment.confirm('test')
70
- expect(spy).toHaveBeenCalled()
71
- expect(isCancelSpy).toHaveBeenCalled()
72
- expect(result).toBe(true)
73
- })
74
-
75
- it('should handle confirm', async () => {
76
- const environment = createUIEnvironment('test', false)
77
- const spy = vi.spyOn(clack, 'confirm').mockImplementation(async () => true)
78
- const isCancelSpy = vi
79
- .spyOn(clack, 'isCancel')
80
- .mockImplementation(() => true)
81
- await environment.confirm('test')
82
- expect(spy).toHaveBeenCalled()
83
- expect(isCancelSpy).toHaveBeenCalled()
84
- })
85
-
86
- it('should handle spinner', async () => {
87
- const environment = createUIEnvironment('test', false)
88
- // @ts-expect-error
89
- const spy = vi.spyOn(clack, 'spinner').mockImplementation(async () => ({
90
- start: (_msg?: string) => {},
91
- stop: (_msg?: string) => {},
92
- message: (_msg?: string) => {},
93
- }))
94
- const result = await environment.spinner()
95
- expect(spy).toHaveBeenCalled()
96
- })
97
- })
@@ -1,233 +0,0 @@
1
- import { describe, it, expect, vi } from 'vitest'
2
-
3
- import * as clack from '@clack/prompts'
4
-
5
- import {
6
- getProjectName,
7
- selectAddOns,
8
- selectGit,
9
- selectPackageManager,
10
- selectTemplate,
11
- selectToolchain,
12
- } from '../src/ui-prompts'
13
-
14
- import type { AddOn, Framework } from '@tanstack/create'
15
-
16
- vi.mock('@clack/prompts')
17
-
18
- vi.spyOn(process, 'exit').mockImplementation((number) => {
19
- throw new Error(`process.exit: ${number}`)
20
- })
21
-
22
- describe('getProjectName', () => {
23
- it('should return the project name', async () => {
24
- vi.spyOn(clack, 'text').mockImplementation(async () => 'my-app')
25
- vi.spyOn(clack, 'isCancel').mockImplementation(() => false)
26
-
27
- const projectName = await getProjectName()
28
- expect(projectName).toBe('my-app')
29
- })
30
-
31
- it('should exit on cancel', async () => {
32
- vi.spyOn(clack, 'text').mockImplementation(async () => 'Cancelled')
33
- vi.spyOn(clack, 'isCancel').mockImplementation(() => true)
34
-
35
- await expect(getProjectName()).rejects.toThrowError(/exit/)
36
- })
37
- })
38
-
39
- describe('selectPackageManager', () => {
40
- it('should select pnpm', async () => {
41
- vi.spyOn(clack, 'select').mockImplementation(async () => 'pnpm')
42
- vi.spyOn(clack, 'isCancel').mockImplementation(() => false)
43
-
44
- const packageManager = await selectPackageManager()
45
- expect(packageManager).toBe('pnpm')
46
- })
47
-
48
- it('should exit on cancel', async () => {
49
- vi.spyOn(clack, 'select').mockImplementation(async () =>
50
- Symbol.for('cancel'),
51
- )
52
- vi.spyOn(clack, 'isCancel').mockImplementation(() => true)
53
-
54
- await expect(selectPackageManager()).rejects.toThrowError(/exit/)
55
- })
56
- })
57
-
58
- describe('selectTemplate', () => {
59
- it('should select a template id', async () => {
60
- vi.spyOn(clack, 'select').mockImplementation(async () => 'blog')
61
- vi.spyOn(clack, 'isCancel').mockImplementation(() => false)
62
-
63
- const selectedTemplate = await selectTemplate([
64
- { id: 'blog', name: 'Blog', description: 'A blog template' },
65
- ])
66
-
67
- expect(selectedTemplate).toBe('blog')
68
- })
69
-
70
- it('should return undefined when no templates are available', async () => {
71
- const selectedTemplate = await selectTemplate([])
72
- expect(selectedTemplate).toBeUndefined()
73
- })
74
-
75
- it('should exit on cancel', async () => {
76
- vi.spyOn(clack, 'select').mockImplementation(async () => Symbol.for('cancel'))
77
- vi.spyOn(clack, 'isCancel').mockImplementation(() => true)
78
-
79
- await expect(
80
- selectTemplate([{ id: 'blog', name: 'Blog' }]),
81
- ).rejects.toThrowError(/exit/)
82
- })
83
- })
84
-
85
- describe('selectAddOns', () => {
86
- it('should show keyboard shortcuts help and select add-ons', async () => {
87
- const noteSpy = vi.spyOn(clack, 'note').mockImplementation(() => {})
88
- const multiselectSpy = vi
89
- .spyOn(clack, 'multiselect')
90
- .mockImplementation(async () => ['add-on-1'])
91
- vi.spyOn(clack, 'isCancel').mockImplementation(() => false)
92
-
93
- const packageManager = await selectAddOns(
94
- {
95
- getAddOns: () =>
96
- [
97
- {
98
- id: 'add-on-1',
99
- name: 'Add-on 1',
100
- description: 'Add-on 1 description',
101
- type: 'add-on',
102
- modes: ['file-router'],
103
- },
104
- ] as Array<AddOn>,
105
- } as Framework,
106
- 'file-router',
107
- 'add-on',
108
- 'Select add-ons',
109
- )
110
-
111
- expect(packageManager).toEqual(['add-on-1'])
112
- expect(noteSpy).toHaveBeenCalledWith(
113
- 'Use ↑/↓ to navigate • Space to select/deselect • Enter to confirm',
114
- 'Keyboard Shortcuts',
115
- )
116
- expect(multiselectSpy).toHaveBeenCalledWith(
117
- expect.objectContaining({ maxItems: 1 }),
118
- )
119
- })
120
-
121
- it('should exit on cancel', async () => {
122
- vi.spyOn(clack, 'select').mockImplementation(async () =>
123
- Symbol.for('cancel'),
124
- )
125
- vi.spyOn(clack, 'isCancel').mockImplementation(() => true)
126
-
127
- await expect(
128
- selectAddOns(
129
- {
130
- getAddOns: () =>
131
- [
132
- {
133
- id: 'add-on-1',
134
- name: 'Add-on 1',
135
- description: 'Add-on 1 description',
136
- type: 'add-on',
137
- modes: ['file-router'],
138
- },
139
- ] as Array<AddOn>,
140
- } as Framework,
141
- 'file-router',
142
- 'add-on',
143
- 'Select add-ons',
144
- ),
145
- ).rejects.toThrowError(/exit/)
146
- })
147
- })
148
-
149
- describe('selectGit', () => {
150
- it('should select git', async () => {
151
- vi.spyOn(clack, 'confirm').mockImplementation(async () => true)
152
- vi.spyOn(clack, 'isCancel').mockImplementation(() => false)
153
-
154
- const git = await selectGit()
155
- expect(git).toBe(true)
156
- })
157
-
158
- it('should exit on cancel', async () => {
159
- vi.spyOn(clack, 'confirm').mockImplementation(async () =>
160
- Symbol.for('cancel'),
161
- )
162
- vi.spyOn(clack, 'isCancel').mockImplementation(() => true)
163
-
164
- await expect(selectGit()).rejects.toThrowError(/exit/)
165
- })
166
- })
167
-
168
- describe('selectToolchain', () => {
169
- it('should select a toolchain', async () => {
170
- vi.spyOn(clack, 'select').mockImplementation(async () => 'biome')
171
- vi.spyOn(clack, 'isCancel').mockImplementation(() => false)
172
-
173
- const packageManager = await selectToolchain({
174
- getAddOns: () =>
175
- [
176
- {
177
- id: 'biome',
178
- name: 'Biome',
179
- description: 'Biome description',
180
- type: 'toolchain',
181
- modes: ['file-router'],
182
- },
183
- ] as Array<AddOn>,
184
- } as Framework)
185
- expect(packageManager).toEqual('biome')
186
- })
187
- it('should select a toolchain', async () => {
188
- const selectSpy = vi
189
- .spyOn(clack, 'select')
190
- .mockImplementation(async () => 'biome')
191
- vi.spyOn(clack, 'isCancel').mockImplementation(() => false)
192
-
193
- const packageManager = await selectToolchain(
194
- {
195
- getAddOns: () =>
196
- [
197
- {
198
- id: 'biome',
199
- name: 'Biome',
200
- description: 'Biome description',
201
- type: 'toolchain',
202
- modes: ['file-router'],
203
- },
204
- ] as Array<AddOn>,
205
- } as Framework,
206
- 'biome',
207
- )
208
- expect(packageManager).toEqual('biome')
209
- expect(selectSpy).not.toHaveBeenCalled()
210
- })
211
-
212
- it('should exit on cancel', async () => {
213
- vi.spyOn(clack, 'select').mockImplementation(async () =>
214
- Symbol.for('cancel'),
215
- )
216
- vi.spyOn(clack, 'isCancel').mockImplementation(() => true)
217
-
218
- await expect(
219
- selectToolchain({
220
- getAddOns: () =>
221
- [
222
- {
223
- id: 'biome',
224
- name: 'Biome',
225
- description: 'Biome description',
226
- type: 'toolchain',
227
- modes: ['file-router'],
228
- },
229
- ] as Array<AddOn>,
230
- } as Framework),
231
- ).rejects.toThrowError(/exit/)
232
- })
233
- })
@@ -1,31 +0,0 @@
1
- import { expect, test } from '@playwright/test'
2
-
3
- import { attachRuntimeGuards, createReactAppFixture } from './helpers'
4
-
5
- test('@blocking creates app with multiple add-ons and renders demo routes', async ({ page }) => {
6
- const fixture = await createReactAppFixture({
7
- appName: 'addons-create-smoke-app',
8
- addOns: ['shadcn', 'form', 'tanstack-query', 'store'],
9
- })
10
- const guards = attachRuntimeGuards(page, fixture.url)
11
-
12
- try {
13
- await page.goto(`${fixture.url}/demo/form/simple`)
14
- await expect(page.getByText('Title', { exact: true })).toBeVisible()
15
- await expect(page.getByRole('button', { name: 'Submit' })).toBeVisible()
16
-
17
- await page.goto(`${fixture.url}/demo/tanstack-query`)
18
- await expect(page.getByRole('heading', { name: /TanStack Query/ })).toBeVisible()
19
-
20
- await page.goto(`${fixture.url}/demo/store`)
21
- await expect(page.getByRole('heading', { name: 'Store Example' })).toBeVisible()
22
- } finally {
23
- try {
24
- guards.assertClean()
25
- } finally {
26
- guards.dispose()
27
- await fixture.stop()
28
- await fixture.cleanup()
29
- }
30
- }
31
- })
@@ -1,39 +0,0 @@
1
- import { expect, test } from '@playwright/test'
2
-
3
- import { attachRuntimeGuards, createReactAppFixture } from './helpers'
4
-
5
- test('@blocking creates a React app and navigates core starter routes', async ({ page }) => {
6
- const fixture = await createReactAppFixture({
7
- appName: 'react-smoke-app',
8
- })
9
- const guards = attachRuntimeGuards(page, fixture.url)
10
-
11
- try {
12
- await page.goto(fixture.url)
13
- await expect(
14
- page.getByRole('heading', {
15
- name: 'Start simple, ship quickly.',
16
- }),
17
- ).toBeVisible()
18
-
19
- await page.getByRole('link', { name: 'About', exact: true }).click()
20
- await expect(page).toHaveURL(/\/about\/?$/)
21
- await expect(
22
- page.getByRole('heading', { name: 'A small starter with room to grow.' }),
23
- ).toBeVisible()
24
-
25
- await page.getByRole('link', { name: 'Home' }).click()
26
- await expect(page).toHaveURL(/\/?$/)
27
- await expect(
28
- page.getByRole('heading', { name: 'Start simple, ship quickly.' }),
29
- ).toBeVisible()
30
- } finally {
31
- try {
32
- guards.assertClean()
33
- } finally {
34
- guards.dispose()
35
- await fixture.stop()
36
- await fixture.cleanup()
37
- }
38
- }
39
- })