Another step to get tests running

This commit is contained in:
Pieter Vander Vennet 2023-02-08 02:47:32 +01:00
parent 071e5bf03a
commit f9f1a30921
6 changed files with 975 additions and 227 deletions

1186
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -129,10 +129,11 @@
"chai": "^4.3.6", "chai": "^4.3.6",
"dependency-cruiser": "^10.4.0", "dependency-cruiser": "^10.4.0",
"fs": "0.0.1-security", "fs": "0.0.1-security",
"jsdom": "^21.1.0",
"prettier": "^2.7.1", "prettier": "^2.7.1",
"prettier-plugin-svelte": "^2.9.0", "prettier-plugin-svelte": "^2.9.0",
"read-file": "^0.2.0", "read-file": "^0.2.0",
"sass": "^1.57.1", "sass": "^1.58.0",
"sharp": "^0.30.5", "sharp": "^0.30.5",
"svelte": "^3.55.1", "svelte": "^3.55.1",
"svelte-check": "^3.0.2", "svelte-check": "^3.0.2",

View file

@ -1,5 +1,4 @@
import { vitePreprocess } from "@sveltejs/vite-plugin-svelte" import { vitePreprocess } from "@sveltejs/vite-plugin-svelte"
export default { export default {
// Consult https://svelte.dev/docs#compile-time-svelte-preprocess // Consult https://svelte.dev/docs#compile-time-svelte-preprocess
// for more information about preprocessors // for more information about preprocessors

View file

@ -102,7 +102,7 @@ describe("PrepareLayer", () => {
offset: 6, offset: 6,
}, },
], ],
titleIcons: [{ render: "defaults", id: "defaults" }], titleIcons: [{ render: "iconsdefaults", id: "icons.defaults" }],
} }
expect(result).toEqual(expected) expect(result).toEqual(expected)

View file

@ -1,5 +1,6 @@
import { defineConfig } from "vite" import { defineConfig } from "vite"
import { svelte } from "@sveltejs/vite-plugin-svelte" import { svelte } from "@sveltejs/vite-plugin-svelte"
import autoPreprocess, { scss } from "svelte-preprocess";
import fs from "fs" import fs from "fs"
const allHtmlFiles = fs.readdirSync(".").filter((f) => f.endsWith(".html")) const allHtmlFiles = fs.readdirSync(".").filter((f) => f.endsWith(".html"))
@ -18,7 +19,7 @@ export default defineConfig({
}, },
}, },
base: `${ASSET_URL}`, base: `${ASSET_URL}`,
plugins: [svelte()], plugins: [svelte({preprocess: [scss() , autoPreprocess()]})],
server: { server: {
port: 1234, port: 1234,
}, },

View file

@ -1,6 +1,11 @@
import { defineConfig } from "vitest/config" import { defineConfig } from "vitest/config"
import { svelte } from '@sveltejs/vite-plugin-svelte'
import autoPreprocess from "svelte-preprocess";
export default defineConfig({ export default defineConfig({
plugins: [
svelte({ hot: !process.env.VITEST,
preprocess: [autoPreprocess()] }),
],
test: { test: {
globals: true, globals: true,
setupFiles: ["./test/testhooks.ts"], setupFiles: ["./test/testhooks.ts"],