Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ecb41cf

Browse filesBrowse files
committed
fix: fix cypress component testing setup in bare mode
1 parent bac1c81 commit ecb41cf
Copy full SHA for ecb41cf

File tree

3 files changed

+17
-2
lines changed
Filter options

3 files changed

+17
-2
lines changed

‎.github/workflows/ci.yml

Copy file name to clipboardExpand all lines: .github/workflows/ci.yml
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ jobs:
171171
run: pnpm --filter '*${{ matrix.e2e-framework }}*' --filter '!*bare*' --workspace-concurrency 1 test:e2e
172172

173173
- name: Cypress component testing for projects without Vitest
174+
working-directory: ./playground
174175
if: ${{ contains(matrix.e2e-framework, 'cypress') }}
175176
run: pnpm --filter '*cypress*' --filter '!*vitest*' --workspace-concurrency 1 test:unit
176177

‎index.ts

Copy file name to clipboardExpand all lines: index.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ async function init() {
628628
}
629629

630630
if (argv.bare) {
631-
removeCSSImport(root, needsTypeScript)
631+
removeCSSImport(root, needsTypeScript, needsCypressCT)
632632
if (needsRouter) {
633633
emptyRouterConfig(root, needsTypeScript)
634634
}

‎utils/trimBoilerplate.ts

Copy file name to clipboardExpand all lines: utils/trimBoilerplate.ts
+15-1Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,24 @@ export function trimBoilerplate(rootDir: string) {
2020
}
2121
}
2222

23-
export function removeCSSImport(rootDir: string, needsTypeScript: boolean) {
23+
export function removeCSSImport(
24+
rootDir: string,
25+
needsTypeScript: boolean,
26+
needsCypressCT: boolean,
27+
) {
2428
// Remove CSS import in the entry file
2529
const entryPath = path.resolve(rootDir, needsTypeScript ? 'src/main.ts' : 'src/main.js')
2630
replaceContent(entryPath, (content) => content.replace("import './assets/main.css'\n\n", ''))
31+
32+
if (needsCypressCT) {
33+
const ctSetupPath = path.resolve(
34+
rootDir,
35+
needsTypeScript ? 'cypress/support/component.ts' : 'cypress/support/component.js',
36+
)
37+
replaceContent(ctSetupPath, (content) =>
38+
content.replace("import '@/assets/main.css'", "// import '@/assets/main.css'"),
39+
)
40+
}
2741
}
2842

2943
export function emptyRouterConfig(rootDir: string, needsTypeScript: boolean) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.