update test case
This commit is contained in:
parent
2fe89029c3
commit
03e70436c6
12
babel.config.js
Normal file
12
babel.config.js
Normal file
@ -0,0 +1,12 @@
|
||||
module.exports = {
|
||||
presets: [['@babel/preset-env', { targets: { node: 'current' } }], '@babel/preset-typescript'],
|
||||
plugins: [
|
||||
['@babel/plugin-proposal-decorators', { legacy: true }],
|
||||
[
|
||||
'@babel/plugin-transform-runtime',
|
||||
{
|
||||
regenerator: true,
|
||||
},
|
||||
],
|
||||
],
|
||||
};
|
14
package.json
14
package.json
@ -46,6 +46,12 @@
|
||||
"yaml": "^2.8.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.27.4",
|
||||
"@babel/plugin-proposal-decorators": "^7.27.1",
|
||||
"@babel/plugin-transform-runtime": "^7.27.4",
|
||||
"@babel/preset-env": "^7.27.2",
|
||||
"@babel/preset-typescript": "^7.27.1",
|
||||
"@babel/runtime": "^7.27.6",
|
||||
"@eslint/compat": "^1.3.0",
|
||||
"@eslint/eslintrc": "^3.3.1",
|
||||
"@eslint/js": "^9.29.0",
|
||||
@ -65,6 +71,7 @@
|
||||
"@types/validator": "^13.15.1",
|
||||
"@typescript-eslint/eslint-plugin": "^8.34.0",
|
||||
"@typescript-eslint/parser": "^8.34.0",
|
||||
"babel-jest": "^30.0.0",
|
||||
"cross-env": "^7.0.3",
|
||||
"eslint": "^9.29.0",
|
||||
"eslint-config-airbnb-base": "^15.0.0",
|
||||
@ -79,6 +86,7 @@
|
||||
"prettier": "^3.5.3",
|
||||
"source-map-support": "^0.5.21",
|
||||
"supertest": "^7.1.1",
|
||||
"ts-babel": "^6.1.7",
|
||||
"ts-jest": "29.4.0",
|
||||
"ts-loader": "^9.5.2",
|
||||
"ts-node": "^10.9.2",
|
||||
@ -98,12 +106,16 @@
|
||||
"<rootDir>/test/**/*.test.ts"
|
||||
],
|
||||
"transform": {
|
||||
"^.+\\.(t|j)s$": "ts-jest"
|
||||
"^.+\\.(js|jsx)$": "babel-jest",
|
||||
"^.+\\.(ts|tsx)?$": "ts-jest"
|
||||
},
|
||||
"collectCoverageFrom": [
|
||||
"**/*.(t|j)s"
|
||||
],
|
||||
"coverageDirectory": "../coverage",
|
||||
"transformIgnorePatterns": [
|
||||
"node_modules/(?!(chalk))"
|
||||
],
|
||||
"testEnvironment": "node"
|
||||
},
|
||||
"pnpm": {
|
||||
|
1220
pnpm-lock.yaml
1220
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
@ -1,3 +1,5 @@
|
||||
import 'reflect-metadata';
|
||||
|
||||
import { createApp, startApp } from './modules/core/helpers/app';
|
||||
import { listened } from './modules/restful/utils';
|
||||
import { createOptions } from './options';
|
||||
|
@ -1,7 +1,6 @@
|
||||
import { describe } from 'node:test';
|
||||
|
||||
import { NestFastifyApplication } from '@nestjs/platform-fastify';
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
|
||||
import { isNil, pick } from 'lodash';
|
||||
import { DataSource } from 'typeorm';
|
||||
@ -13,8 +12,6 @@ import {
|
||||
PostRepository,
|
||||
TagRepository,
|
||||
} from '@/modules/content/repositories';
|
||||
|
||||
import { CoreModule } from '@/modules/core/core.module';
|
||||
import { createApp } from '@/modules/core/helpers/app';
|
||||
import { App } from '@/modules/core/types';
|
||||
import { MeiliService } from '@/modules/meilisearch/meili.service';
|
||||
@ -39,9 +36,6 @@ describe('nest app test', () => {
|
||||
let searchService: MeiliService;
|
||||
|
||||
beforeAll(async () => {
|
||||
const module: TestingModule = await Test.createTestingModule({
|
||||
imports: [CoreModule],
|
||||
}).compile();
|
||||
const appConfig: App = await createApp(createOptions)();
|
||||
app = appConfig.container;
|
||||
await app.init();
|
||||
@ -52,7 +46,7 @@ describe('nest app test', () => {
|
||||
postRepository = app.get<PostRepository>(PostRepository);
|
||||
commentRepository = app.get<CommentRepository>(CommentRepository);
|
||||
searchService = app.get<MeiliService>(MeiliService);
|
||||
datasource = module.get<DataSource>(DataSource);
|
||||
datasource = app.get<DataSource>(DataSource);
|
||||
if (!datasource.isInitialized) {
|
||||
await datasource.initialize();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user