Skip to content

Commit 593c7e7

Browse files
refactor: seed wallet data with .insert
1 parent 05aa8ef commit 593c7e7

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

.jest/globalSetup.ts

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,7 @@ import knex, { TableNames } from '../server/infra/database/knex';
1212
export default async function globalSetup() {
1313
if (process.env.SEED === 'true') {
1414
await knex(TableNames.Trees).insert(exampleTree);
15-
// seed wallet data
16-
await knex.raw(
17-
`insert into wallet.wallet ("created_at", "id", "logo_url", "name", "password", "salt") values (?, ?, ?, ?, ?, ?)`,
18-
[
19-
exampleWallet.created_at,
20-
exampleWallet.id,
21-
exampleWallet.logo_url,
22-
exampleWallet.name,
23-
exampleWallet.password,
24-
exampleWallet.salt,
25-
],
26-
);
27-
15+
await knex('wallet').withSchema('wallet').insert(exampleWallet);
2816
await knex('token').withSchema('wallet').insert(exampleToken);
2917
await knex(TableNames.Species).insert(exampleSpecies);
3018
await knex(TableNames.Organizations).insert(exampleOrganization);
@@ -34,6 +22,7 @@ export default async function globalSetup() {
3422
type: 'country',
3523
});
3624
await knex(TableNames.Countries).insert(exampleCountry);
25+
3726
}
3827
knex.destroy();
3928
}

0 commit comments

Comments
 (0)