Files
cnpmcore/config/config.unittest.ts
fengmk2 4427a4fca5 feat: use egg v4 (#747)
BREAKING CHANGE: only support egg >= 4.0.0

the first app on egg v4

https://github.com/eggjs/egg/issues/3644
2025-02-09 15:43:24 +08:00

33 lines
717 B
TypeScript

import { join } from 'node:path';
import { EggAppConfig, PowerPartial } from 'egg';
import Mock from '@elastic/elasticsearch-mock';
import { database } from './database';
export const mockES = new Mock();
export default (appInfo: EggAppConfig) => {
const config = {} as PowerPartial<EggAppConfig>;
config.dataDir = join(appInfo.root, '.cnpmcore_unittest');
config.orm = {
database: database.name || 'cnpmcore_unittest',
};
config.nfs = {
dir: join(config.dataDir, 'nfs'),
};
config.cnpmcore = {
checkChangesStreamInterval: 10,
};
config.elasticsearch = {
client: {
node: 'http://localhost:9200',
Connection: mockES.getConnection(),
},
};
return config;
};