Skip to content

Commit

Permalink
chore(test): use globals
Browse files Browse the repository at this point in the history
  • Loading branch information
metonym committed Mar 31, 2024
1 parent 20376ae commit 4635a0f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
1 change: 0 additions & 1 deletion tests/bar-chart-race.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import userEvent from "@testing-library/user-event";
import type { SvelteComponent } from "svelte";
import { afterEach, describe, expect, test } from "vitest";
import KitchenSink from "../demo/KitchenSink/+page.svelte";
import Simple from "../demo/Simple/+page.svelte";
import TwoWayBinding from "../demo/TwoWayBinding/+page.svelte";
Expand Down
1 change: 0 additions & 1 deletion tests/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { expect, it } from "vitest";
import * as pkg from "../package.json";
import * as API from "../src";

Expand Down
3 changes: 3 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"extends": "./.svelte-kit/tsconfig.json",
"compilerOptions": {
"types": ["svelte", "vitest/globals"]
},
"include": [".svelte-kit/**/*", "demo/*", "src/*", "tests/*"]
}
5 changes: 4 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/// <reference types="vitest" />
/// <reference types="@sveltejs/kit" />
import { sveltekit } from "@sveltejs/kit/vite";
import path from "path";
import path from "node:path";
import { defineConfig } from "vite";
import pkg from "./package.json";

Expand All @@ -11,6 +13,7 @@ export default defineConfig({
},
},
test: {
globals: true,
environment: "jsdom",
},
});

0 comments on commit 4635a0f

Please sign in to comment.