Skip to content

Commit

Permalink
feat(models): update entitiy test bed
Browse files Browse the repository at this point in the history
  • Loading branch information
zlq4863947 committed Mar 3, 2019
1 parent 090d0c4 commit a670eb5
Show file tree
Hide file tree
Showing 17 changed files with 323 additions and 154 deletions.
31 changes: 31 additions & 0 deletions config/default.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
require('dotenv').config();

module.exports = {
env: 'default',
production: false,
database: {
type: 'mysql',
replication: {
master: {
host: 'localhost',
port: 3306,
username: 'root',
password: process.env.MYSQL_PASSWORD,
database: 'test',
},
slaves: [
{
host: 'localhost',
port: 3306,
username: 'root',
password: process.env.MYSQL_PASSWORD,
database: 'test',
},
],
},
entities: ['dist/modules/models/entity/**/*.entity.js'],
},
log: {
typeorm: true,
},
};
20 changes: 20 additions & 0 deletions config/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* Config for test in local development (run on ts-node).
*
* Jest force set NODE_ENV=test
* https://github.com/facebook/jest/issues/3370
*/

const config = require('./default');

config.env = 'test';

config.database = {
...config.database,
entities: ['modules/models/entity/**/*.entity.ts'],
};
config.log = {
typeorm: false,
}

module.exports = config;
1 change: 0 additions & 1 deletion modules/models/common/constants.ts

This file was deleted.

1 change: 0 additions & 1 deletion modules/models/common/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export * from './transformers';
export * from './constants';
export * from './testing';
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { MasterPairEntity, MasterSpotPairRepository } from '@dripjs/models';
import { ObjectType } from 'typeorm';

import { MasterPairEntity, MasterSpotPairRepository } from '../../../entity';

export const allEntityTypes: ObjectType<any>[] = [MasterPairEntity];

export const allRepositoryTypes: ObjectType<any>[] = [MasterSpotPairRepository];
Loading

0 comments on commit a670eb5

Please sign in to comment.