Skip to content

Commit

Permalink
test: pass process.env.DB to connection.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
fratzinger committed May 13, 2024
1 parent c65f84f commit 917ede1
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion test/connection.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Sequelize } from 'sequelize';

export default (DB?: 'postgres' | 'mysql') => {
export default (DB?: 'postgres' | 'mysql' | string) => {
console.log('DB:', DB);
if (DB === 'postgres') {
return new Sequelize('sequelize', 'postgres', 'password', {
Expand Down
2 changes: 1 addition & 1 deletion test/hooks.dehydrate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Sequelize from 'sequelize';

import { dehydrate } from '../src/hooks/dehydrate';
import makeConnection from './connection';
const sequelize = makeConnection();
const sequelize = makeConnection(process.env.DB);

type MethodName = 'find' | 'get' | 'create' | 'update' | 'patch' | 'remove';

Expand Down
2 changes: 1 addition & 1 deletion test/hooks.hydrate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Sequelize from 'sequelize';

import { hydrate } from '../src/hooks/hydrate';
import makeConnection from './connection'
const sequelize = makeConnection();
const sequelize = makeConnection(process.env.DB);

type MethodName = 'find' | 'get' | 'create' | 'update' | 'patch' | 'remove';

Expand Down
2 changes: 1 addition & 1 deletion test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const testSuite = adaptertests([
// https://github.com/sequelize/sequelize/issues/1774
pg.defaults.parseInt8 = true;

const sequelize = makeConnection();
const sequelize = makeConnection(process.env.DB);

const Model = sequelize.define('people', {
name: {
Expand Down

0 comments on commit 917ede1

Please sign in to comment.