Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ymc9 committed Jun 2, 2024
1 parent b7b4af7 commit 76059e3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
8 changes: 3 additions & 5 deletions packages/schema/tests/generator/prisma-generator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ describe('Prisma generator test', () => {
provider = 'postgresql'
url = env("DATABASE_URL")
directUrl = env("DATABASE_URL")
shadowDatabaseUrl = env("DATABASE_URL")
extensions = [pg_trgm, postgis(version: "3.3.2"), uuid_ossp(map: "uuid-ossp", schema: "extensions")]
schemas = ["auth", "public"]
}
Expand Down Expand Up @@ -67,7 +66,6 @@ describe('Prisma generator test', () => {
expect(content).toContain('provider = "postgresql"');
expect(content).toContain('url = env("DATABASE_URL")');
expect(content).toContain('directUrl = env("DATABASE_URL")');
expect(content).toContain('shadowDatabaseUrl = env("DATABASE_URL")');
expect(content).toContain(
'extensions = [pg_trgm, postgis(version: "3.3.2"), uuid_ossp(map: "uuid-ossp", schema: "extensions")]'
);
Expand Down Expand Up @@ -253,9 +251,9 @@ describe('Prisma generator test', () => {
expect(content).toContain(`@@map("_Role")`);
expect(content).toContain(`@map("admin")`);
expect(content).toContain(`@map("customer")`);
expect(content).toContain('/// Admin role documentation line 1\n' +
' /// Admin role documentation line 2\n' +
' ADMIN');
expect(content).toContain(
'/// Admin role documentation line 1\n' + ' /// Admin role documentation line 2\n' + ' ADMIN'
);
});

it('attribute passthrough', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ describe('Datasource Validation Tests', () => {
cause: [
{ message: 'datasource must include a "provider" field' },
{ message: 'datasource must include a "url" field' },
]
}
})
],
},
});
});

it('dup fields', async () => {
Expand Down Expand Up @@ -63,14 +63,6 @@ describe('Datasource Validation Tests', () => {
}
`)
).toContain('"url" must be set to a string literal or an invocation of "env" function');

expect(
await loadModelWithError(`
datasource db {
shadowDatabaseUrl = 123
}
`)
).toContain('"shadowDatabaseUrl" must be set to a string literal or an invocation of "env" function');
});

it('invalid relationMode value', async () => {
Expand All @@ -96,7 +88,6 @@ describe('Datasource Validation Tests', () => {
datasource db {
provider = "postgresql"
url = "url"
shadowDatabaseUrl = "shadow"
relationMode = "prisma"
}
`);
Expand All @@ -105,7 +96,6 @@ describe('Datasource Validation Tests', () => {
datasource db {
provider = "postgresql"
url = env("url")
shadowDatabaseUrl = env("shadowUrl")
relationMode = "foreignKeys"
}
`);
Expand Down

0 comments on commit 76059e3

Please sign in to comment.