Skip to content

Commit

Permalink
Moves before each inside of describe
Browse files Browse the repository at this point in the history
  • Loading branch information
3commascapital committed Sep 14, 2024
1 parent 9d380fe commit 0df9cf6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions packages/core/src/database/postgres/service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ import { beforeEach, describe, expect, test } from "vitest";
import type { HeadlessKysely } from "../kysely.js";
import { PostgresDatabaseService } from "./service.js";

beforeEach(setupCommon);
beforeEach(setupIsolatedDatabase);

const schema = createSchema((p) => ({
PetKind: p.createEnum(["CAT", "DOG"]),
Pet: p.createTable(
Expand Down Expand Up @@ -83,6 +80,9 @@ const schemaWithDefaults = createSchema((p) => ({
const shouldSkip = !process.env.DATABASE_URL;

describe.skipIf(shouldSkip)("postgres database", () => {
beforeEach(setupCommon);
beforeEach(setupIsolatedDatabase);

test("setup succeeds with a fresh database", async (context) => {
if (context.databaseConfig.kind !== "postgres") return;
const database = new PostgresDatabaseService({
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/database/sqlite/service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ import { beforeEach, describe, expect, test } from "vitest";
import type { HeadlessKysely } from "../kysely.js";
import { SqliteDatabaseService } from "./service.js";

beforeEach(setupCommon);
beforeEach(setupIsolatedDatabase);

const schema = createSchema((p) => ({
PetKind: p.createEnum(["CAT", "DOG"]),
Pet: p.createTable(
Expand Down Expand Up @@ -58,6 +55,9 @@ const schemaTwo = createSchema((p) => ({
const shouldSkip = !!process.env.DATABASE_URL;

describe.skipIf(shouldSkip)("sqlite database", () => {
beforeEach(setupCommon);
beforeEach(setupIsolatedDatabase);

test("setup succeeds with a fresh database", async (context) => {
if (context.databaseConfig.kind !== "sqlite") return;
const database = new SqliteDatabaseService({
Expand Down

0 comments on commit 0df9cf6

Please sign in to comment.