Skip to content

Commit 67fa72e

Browse files
committed
fix tests
1 parent 459237c commit 67fa72e

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

backend/src/entities/team.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";
22

3+
function Longtext() {
4+
// Sqlite doesn't support longtext. I hate this, but it is what it is if we want
5+
// to keep backend tests and prepare tilt for the upcoming Hackaburg as quickly
6+
// as possible.
7+
if (process.env.NODE_ENV === 'test') {
8+
return Column("text");
9+
}
10+
return Column("longtext");
11+
}
12+
313
@Entity()
414
export class Team {
515
@PrimaryGeneratedColumn()
@@ -10,7 +20,7 @@ export class Team {
1020
public users!: number[];
1121
@Column()
1222
public teamImg!: string;
13-
@Column("longtext")
23+
@Longtext()
1424
public description!: string;
1525
@Column("simple-array")
1626
public requests!: number[];

backend/test/services/mock/mock-database-service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export class TestDatabaseService implements IDatabaseService {
4242
database: ":memory:",
4343
entities: [join(__dirname, "../../../src/entities/*")],
4444
synchronize: true,
45-
type: "mysql",
45+
type: "sqlite",
4646
});
4747
}
4848
}

0 commit comments

Comments
 (0)