Skip to content

Commit fd2b640

Browse files
committed
added test of jsconfig
1 parent e760f03 commit fd2b640

File tree

4 files changed

+80
-0
lines changed

4 files changed

+80
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"style": "new-york",
3+
"tailwind": {
4+
"config": "tailwind.config.js",
5+
"css": "src/app.pcss",
6+
"baseColor": "zinc"
7+
},
8+
"aliases": {
9+
"utils": "$lib/utils",
10+
"components": "$lib/components"
11+
}
12+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"compilerOptions": {
3+
"allowJs": true,
4+
"checkJs": true,
5+
"esModuleInterop": true,
6+
"forceConsistentCasingInFileNames": true,
7+
"resolveJsonModule": true,
8+
"skipLibCheck": true,
9+
"sourceMap": true,
10+
"strict": true,
11+
"moduleResolution": "bundler",
12+
"paths": {
13+
"$lib": ["./src/lib"],
14+
"$lib/*": ["./src/lib/*"]
15+
}
16+
}
17+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "test-cli-config-full",
3+
"version": "0.0.0",
4+
"private": true,
5+
"devDependencies": {
6+
"@sveltejs/vite-plugin-svelte": "^3.0.0",
7+
"svelte": "^4.2.7",
8+
"svelte-check": "^3.6.0",
9+
"tslib": "^2.4.1",
10+
"typescript": "^5.0.0",
11+
"vite": "^5.0.3"
12+
},
13+
"type": "module"
14+
}

packages/cli/test/utils/get-config.spec.ts

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,4 +165,41 @@ describe("getConfig", () => {
165165
}
166166
});
167167
});
168+
169+
it("handles cases where the project uses jsconfig.json", async () => {
170+
expect(await getConf("config-jsconfig")).toEqual({
171+
style: "new-york",
172+
tailwind: {
173+
config: "tailwind.config.js",
174+
css: "src/app.pcss",
175+
baseColor: "zinc"
176+
},
177+
aliases: {
178+
utils: "$lib/utils",
179+
components: "$lib/components"
180+
},
181+
resolvedPaths: {
182+
components: path.resolve(
183+
__dirname,
184+
"../fixtures/config-jsconfig",
185+
"./src/lib/components"
186+
),
187+
tailwindConfig: path.resolve(
188+
__dirname,
189+
"../fixtures/config-jsconfig",
190+
"./tailwind.config.js"
191+
),
192+
tailwindCss: path.resolve(
193+
__dirname,
194+
"../fixtures/config-jsconfig",
195+
"./src/app.pcss"
196+
),
197+
utils: path.resolve(
198+
__dirname,
199+
"../fixtures/config-jsconfig",
200+
"./src/lib/utils"
201+
)
202+
}
203+
});
204+
});
168205
});

0 commit comments

Comments
 (0)