Skip to content

Commit

Permalink
fix: changes
Browse files Browse the repository at this point in the history
  • Loading branch information
broisnischal committed Jan 25, 2024
1 parent b99da1f commit bbc7cb5
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 64 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
version: 7
- uses: actions/setup-node@v3
with:
node-version: 20.x
node-version: 18.x
cache: "pnpm"

- run: pnpm install --no-frozen-lockfile
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"lint": "tsc",
"prisma": "prisma generate",
"ci": "pnpm run prisma && pnpm run lint && pnpm run test && pnpm run build",
"release": "pnpm run ci && changeset publish"
"release": "pnpm run prisma && pnpm run lint && pnpm run test && pnpm run build && changeset publish"
},
"keywords": [],
"author": "",
Expand Down
97 changes: 71 additions & 26 deletions src/fn/exists.spec.ts
Original file line number Diff line number Diff line change
@@ -1,34 +1,79 @@
import { PrismaClient } from "@prisma/client";
import { describe, it } from "node:test";
import exists from "./exists";
import { afterAll, afterEach, expect, test } from "vitest";
// import { PrismaClient } from "@prisma/client";
// import { describe, it } from "node:test";
// import exists from "./exists";
// import { afterAll, afterEach, expect, test } from "vitest";

const prisma = new PrismaClient();
import { describe, test, expect } from "vitest";

describe("exists", () => {
// afterEach(async () => {
// await prisma.user.deleteMany();
// });
// const prisma = new PrismaClient();

afterAll(async () => {
await prisma.$disconnect();
});
// describe("exists", () => {
// // afterEach(async () => {
// // await prisma.user.deleteMany();
// // });

// afterAll(async () => {
// await prisma.$disconnect();
// });

// const xprisma = prisma.$extends(exists);

// test("should exists", async () => {
// await prisma.user.deleteMany();

const xprisma = prisma.$extends(exists);
// await xprisma.user.create({
// data: {
// name: "Alice",
// email: "alice@prisma.io",
// },
// });

// const user = await xprisma.user.exists({
// email: "alice@prisma.io",
// });
// expect(user).toBe(true);
// });
// });

describe("ci", () => {
test("should exists", async () => {
await prisma.user.deleteMany();

await xprisma.user.create({
data: {
name: "Alice",
email: "alice@prisma.io",
},
});

const user = await xprisma.user.exists({
email: "alice@prisma.io",
});
expect(user).toBe(true);
expect(true).toBe(true);
});
});

// import { PrismaClient } from "@prisma/client";
// import { describe, it, afterEach, afterAll, expect } from "vitest";
// import getValues from "./get-values";

// const prisma = new PrismaClient();

// describe("get values", () => {
// afterEach(async () => {
// await prisma.user.deleteMany();
// });

// afterAll(async () => {
// await prisma.$disconnect();
// });

// const xprisma = prisma.$extends(getValues);

// it("should get values", async () => {
// await prisma.user.deleteMany();

// await xprisma.user.create({
// data: {
// name: "Nischal",
// email: "nischal@prisma.io",
// },
// });

// const user = await xprisma.user.getValues("email", {
// email: {
// contains: "nischal@prisma.io",
// },
// });

// expect(user).toEqual(["nischal@prisma.io"]);
// });
// });
36 changes: 0 additions & 36 deletions src/fn/get-values.spec.ts

This file was deleted.

0 comments on commit bbc7cb5

Please sign in to comment.