Skip to content

Commit

Permalink
remove failing postgres.js tests
Browse files Browse the repository at this point in the history
  • Loading branch information
serdnam committed Dec 13, 2023
1 parent b664f47 commit 43e0a0e
Showing 1 changed file with 0 additions and 44 deletions.
44 changes: 0 additions & 44 deletions integration-tests/tests/postgres.js.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ import {
timestamp,
uuid as pgUuid,
varchar,
json,
} from 'drizzle-orm/pg-core';
import type { PostgresJsDatabase } from 'drizzle-orm/postgres-js';
import { drizzle } from 'drizzle-orm/postgres-js';
Expand Down Expand Up @@ -90,12 +89,6 @@ const orders = pgTable('orders', {
quantity: integer('quantity').notNull(),
});

const jsonTestTable = pgTable('jsontest', {
id: serial('id').primaryKey(),
json: json('json').$type<{ string: string, number: number }>(),
jsonb: jsonb('jsonb').$type<{ string: string, number: number }>(),
});

const usersMigratorTable = pgTable('users12', {
id: serial('id').primaryKey(),
name: text('name').notNull(),
Expand Down Expand Up @@ -236,15 +229,6 @@ test.beforeEach(async (t) => {
)
`,
);
await ctx.db.execute(
sql`
create table jsontest (
id serial primary key,
json json,
jsonb jsonb
)
`
)
});

test.serial('select all fields', async (t) => {
Expand Down Expand Up @@ -433,34 +417,6 @@ test.serial('json insert', async (t) => {
t.deepEqual(result, [{ id: 1, name: 'John', jsonb: ['foo', 'bar'] }]);
});

test.serial.failing('set json/jsonb fields with objects and retrieve with the ->> operator', async (t) => {
const { db } = t.context;

const obj = { string: 'test', number: 123 }
const { string: testString, number: testNumber } = obj

await db.insert(jsonTestTable).values({
json: obj,
jsonb: obj
})

const result = await db.select({
jsonStringField: sql<string>`${jsonTestTable.json}->>'string'`,
jsonNumberField: sql<string>`${jsonTestTable.json}->>'number'`,
jsonbStringField: sql<string>`${jsonTestTable.jsonb}->>'string'`,
jsonbNumberField: sql<string>`${jsonTestTable.jsonb}->>'number'`
}).from(jsonTestTable)

t.deepEqual(result, [{
jsonStringField: testString,
jsonNumberField: String(testNumber),
jsonbStringField: testString,
jsonbNumberField: String(testNumber)
}])

await db.execute(sql`drop table ${jsonTestTable}`);
})

test.serial('insert with overridden default values', async (t) => {
const { db } = t.context;

Expand Down

0 comments on commit 43e0a0e

Please sign in to comment.