From 54215ef5d026f52f4c3c257b80f8e21071749bae Mon Sep 17 00:00:00 2001 From: gioboa Date: Mon, 25 Aug 2025 17:39:00 +0200 Subject: [PATCH] =?UTF-8?q?test:=20improve=20mergeIntegrationDir=20tests?= =?UTF-8?q?=20=F0=9F=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/qwik/src/cli/add/update-files.unit.ts | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/packages/qwik/src/cli/add/update-files.unit.ts b/packages/qwik/src/cli/add/update-files.unit.ts index a9124795d4c..87a5e88018b 100644 --- a/packages/qwik/src/cli/add/update-files.unit.ts +++ b/packages/qwik/src/cli/add/update-files.unit.ts @@ -114,10 +114,18 @@ describe('mergeIntegrationDir', () => { expect(actualResults).toEqual(expectedResults); - const actualGlobalCssContent = fakeFileUpdates.files.find( - (f) => f.path === `destDir/subDestDir/apps/subpackage/src/global.css` - )?.content; - - expect(actualGlobalCssContent).toBe('p{color: red}\n\n/* CSS */\n'); + const tests = { + 'destDir/subDestDir/apps/subpackage/fake.ts': 'fake file', + 'destDir/subDestDir/should-stay-in-root.ts': 'fake file', + 'destDir/subDestDir/package.json': '{"name": "fake"}', + 'destDir/subDestDir/should-stay/should-also-stay.ts': 'fake file', + 'destDir/subDestDir/apps/subpackage/.vscode/settings.json': + '{ \n // Comment Foo\n "css.lint.unknownAtRules": "ignore",\n "name": "John Doe",\n "age": 42\n }\n', + 'destDir/subDestDir/apps/subpackage/src/global.css': 'p{color: red}\n\n/* CSS */\n', + }; + for (const [fileName, content] of Object.entries(tests)) { + const file = fakeFileUpdates.files.find((f) => f.path === fileName); + expect(file?.content.toString()).toBe(content); + } }); });