diff --git a/playwright.config.ts b/playwright.config.ts index 8284a33..1910d72 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -1,7 +1,8 @@ import { defineConfig, devices } from "@playwright/test"; export default defineConfig({ - testDir: "./src/tests/e2e", + testDir: "./src", + testMatch: "**/*.e2e.{ts,js}", fullyParallel: true, forbidOnly: !!process.env.CI, retries: process.env.CI ? 2 : 0, @@ -26,7 +27,7 @@ export default defineConfig({ }, ], webServer: { - command: "npm run build && npm run preview", + command: "bun run build && bun run preview", port: 4173, }, }); diff --git a/src/app/routes/+layout.svelte b/src/app/routes/+layout.svelte index b2cbdbf..fa68a46 100644 --- a/src/app/routes/+layout.svelte +++ b/src/app/routes/+layout.svelte @@ -1,6 +1,6 @@ diff --git a/src/lib/index.ts b/src/lib/index.ts deleted file mode 100644 index 856f2b6..0000000 --- a/src/lib/index.ts +++ /dev/null @@ -1 +0,0 @@ -// place files you want to import through the `$lib` alias in this folder. diff --git a/src/lib/assets/favicon.svg b/src/shared/assets/favicon.svg similarity index 100% rename from src/lib/assets/favicon.svg rename to src/shared/assets/favicon.svg diff --git a/src/tests/setup.ts b/src/shared/config/tests/setup.ts similarity index 66% rename from src/tests/setup.ts rename to src/shared/config/tests/setup.ts index 42246b2..bc9922e 100644 --- a/src/tests/setup.ts +++ b/src/shared/config/tests/setup.ts @@ -1,4 +1,4 @@ -import { expect, afterEach } from 'vitest'; +import { afterEach } from 'vitest'; import { cleanup } from '@testing-library/svelte'; afterEach(() => { diff --git a/src/tests/basic.test.ts b/src/tests/basic.test.ts deleted file mode 100644 index d6c85f5..0000000 --- a/src/tests/basic.test.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { describe, it, expect } from 'vitest'; - -describe('Basic tests', () => { - it('should add numbers correctly', () => { - expect(1 + 1).toBe(2); - }); - - it('should subtract numbers correctly', () => { - expect(5 - 3).toBe(2); - }); -}); diff --git a/src/tests/e2e/homepage.spec.ts b/src/tests/e2e/homepage.spec.ts deleted file mode 100644 index 8735326..0000000 --- a/src/tests/e2e/homepage.spec.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { test, expect } from '@playwright/test'; - -test('homepage loads correctly', async ({ page }) => { - await page.goto('/'); - await expect(page).toHaveTitle(/allmywork/); -}); diff --git a/svelte.config.js b/svelte.config.js index fc7ffe9..a343a32 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -13,7 +13,7 @@ const config = { routes: "src/app/routes", }, alias: { - $lib: path.resolve("src/lib"), + $lib: path.resolve("src/shared/lib"), $shared: path.resolve("src/shared"), $pages: path.resolve("src/pages"), $features: path.resolve("src/features"), diff --git a/vite.config.ts b/vite.config.ts index 74c5f04..3b57306 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -6,7 +6,7 @@ export default defineConfig({ plugins: [sveltekit()], resolve: { alias: { - $lib: path.resolve("./src/lib"), + $lib: path.resolve("./src/shared/lib"), }, }, }); diff --git a/vitest.config.ts b/vitest.config.ts index d8ff074..74ef881 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -20,9 +20,9 @@ export default defineConfig({ test: { globals: true, environment: "jsdom", - setupFiles: ["./src/tests/setup.ts"], - include: ["src/**/*.{test,spec}.{js,ts}"], - exclude: ["src/tests/e2e/**/*.{test,spec}.{js,ts}"], + setupFiles: ["./src/shared/config/tests/setup.ts"], + include: ["src/**/*.test.{js,ts}"], + exclude: ["src/**/*.e2e.{js,ts}"], projects: [ { extends: true, @@ -52,7 +52,7 @@ export default defineConfig({ }, resolve: { alias: { - $lib: path.resolve("./src/lib"), + $lib: path.resolve("./src/shared/lib"), $shared: path.resolve("./src/shared"), $pages: path.resolve("./src/pages"), $features: path.resolve("./src/features"), diff --git a/vitest.unit.config.ts b/vitest.unit.config.ts index 20ebad3..eab706f 100644 --- a/vitest.unit.config.ts +++ b/vitest.unit.config.ts @@ -17,13 +17,13 @@ export default defineConfig({ test: { globals: true, environment: "jsdom", - setupFiles: ["./src/tests/setup.ts"], - include: ["src/**/*.{test,spec}.{js,ts}"], - exclude: ["src/tests/e2e/**/*.{test,spec}.{js,ts}"], + setupFiles: ["./src/shared/config/tests/setup.ts"], + include: ["src/**/*.test.{js,ts}"], + exclude: ["src/**/*.e2e.{js,ts}"], }, resolve: { alias: { - $lib: path.resolve("./src/lib"), + $lib: path.resolve("./src/shared/lib"), $shared: path.resolve("./src/shared"), $pages: path.resolve("./src/pages"), $features: path.resolve("./src/features"),