mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-12-27 10:31:22 +08:00
rework `onChild` to behave mostly like jQuery `.on` with selector. - we remove `currentTarget` from the `onChild` event handler because native events and jQuery events have different values for it - the jQuery `currentTarget` is available with `childTarget` in our events --------- Co-authored-by: Miodec <jack@monkeytype.com>
37 lines
980 B
TypeScript
37 lines
980 B
TypeScript
import { defineConfig, UserWorkspaceConfig } from "vitest/config";
|
|
import { projects as backendProjects } from "./backend/vitest.config";
|
|
import { projects as frontendProjects } from "./frontend/vitest.config";
|
|
|
|
export default defineConfig({
|
|
test: {
|
|
projects: [
|
|
...convertTests(backendProjects, "backend"),
|
|
...convertTests(frontendProjects, "frontend"),
|
|
"packages/**/vitest.config.ts",
|
|
],
|
|
},
|
|
});
|
|
|
|
function convertTests(
|
|
projects: unknown[],
|
|
root: string,
|
|
): UserWorkspaceConfig[] {
|
|
return (projects as UserWorkspaceConfig[]).map((it) => {
|
|
const test = it.test ?? {};
|
|
const name: string | { label: string } = test.name ?? "unknown";
|
|
|
|
let updatedName =
|
|
name === null || typeof name === "string"
|
|
? `${name} (${root})`
|
|
: { ...name, label: `${name.label} (${root})` };
|
|
|
|
return {
|
|
...it,
|
|
test: {
|
|
...test,
|
|
root,
|
|
name: updatedName,
|
|
},
|
|
} as UserWorkspaceConfig;
|
|
});
|
|
}
|