Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commitecb41cf

Browse files
committed
fix: fix cypress component testing setup in bare mode
1 parentbac1c81 commitecb41cf

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

‎.github/workflows/ci.yml

Lines 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

Lines 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

Lines 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-
exportfunctionremoveCSSImport(rootDir:string,needsTypeScript:boolean){
23+
exportfunctionremoveCSSImport(
24+
rootDir:string,
25+
needsTypeScript:boolean,
26+
needsCypressCT:boolean,
27+
){
2428
// Remove CSS import in the entry file
2529
constentryPath=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+
constctSetupPath=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
exportfunctionemptyRouterConfig(rootDir:string,needsTypeScript:boolean){

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp