feat: Add unit tests for resolvers and services, update dependencies, and remove unused scripts.
This commit is contained in:
@@ -1,31 +1,47 @@
|
||||
import { defineWorkersConfig } from "@cloudflare/vitest-pool-workers/config";
|
||||
import {
|
||||
defineWorkersProject,
|
||||
readD1Migrations,
|
||||
} from "@cloudflare/vitest-pool-workers/config";
|
||||
import tsconfigPaths from "vite-tsconfig-paths";
|
||||
import { configDefaults } from "vitest/config";
|
||||
|
||||
export default defineWorkersConfig({
|
||||
plugins: [tsconfigPaths()],
|
||||
test: {
|
||||
globals: false,
|
||||
setupFiles: ["./testSetup.ts"],
|
||||
poolOptions: {
|
||||
workers: {
|
||||
wrangler: { configPath: "./wrangler.toml" },
|
||||
import path from "node:path";
|
||||
|
||||
export default defineWorkersProject(async () => {
|
||||
const migrationsPath = path.join(__dirname, "drizzle");
|
||||
let migrations: Awaited<ReturnType<typeof readD1Migrations>>;
|
||||
try {
|
||||
migrations = await readD1Migrations(migrationsPath);
|
||||
} catch (e) {
|
||||
console.warn("Could not read migrations", e);
|
||||
migrations = [];
|
||||
}
|
||||
|
||||
return {
|
||||
plugins: [tsconfigPaths()],
|
||||
test: {
|
||||
globals: false,
|
||||
setupFiles: ["./testSetup.ts"],
|
||||
poolOptions: {
|
||||
workers: {
|
||||
wrangler: { configPath: "./wrangler.toml" },
|
||||
},
|
||||
},
|
||||
coverage: {
|
||||
...configDefaults.coverage,
|
||||
provider: "istanbul",
|
||||
reporter: ["text", "json", "html"],
|
||||
exclude: [
|
||||
...configDefaults.coverage.exclude,
|
||||
"node_modules/**",
|
||||
"dist/**",
|
||||
"**/*.spec.ts",
|
||||
"**/*.d.ts",
|
||||
"**/mocks/**",
|
||||
"drizzle.config.ts",
|
||||
"src/schema.ts",
|
||||
],
|
||||
},
|
||||
},
|
||||
coverage: {
|
||||
...configDefaults.coverage,
|
||||
provider: "v8",
|
||||
reporter: ["text", "json", "html"],
|
||||
exclude: [
|
||||
...configDefaults.coverage.exclude,
|
||||
"node_modules/**",
|
||||
"dist/**",
|
||||
"**/*.spec.ts",
|
||||
"**/*.d.ts",
|
||||
"**/mocks/**",
|
||||
"drizzle.config.ts",
|
||||
"src/schema.ts",
|
||||
],
|
||||
},
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user