Skip to content

Commit

Permalink
🚑 fix workflow run error
Browse files Browse the repository at this point in the history
  • Loading branch information
ileostar committed Jul 12, 2024
1 parent 038e641 commit 614421c
Show file tree
Hide file tree
Showing 18 changed files with 742 additions and 347 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,4 @@ dist
.yarn/install-state.gz
.pnp.*

.
.turbo/
3 changes: 0 additions & 3 deletions apps/monitor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
Expand Down
2 changes: 1 addition & 1 deletion apps/server/.env.test
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
DATABASE_URL="mysql://root:root@127.0.0.1:3306/poster_craft"
DATABASE_URL="mysql://root:liuxingyu@127.0.0.1:3306/poster_craft"
SECRET="sjldk92#sd903mnc./xklsjdf9sdfj"
REDIS_URL="redis://127.0.0.1:6379"
10 changes: 10 additions & 0 deletions apps/server/jest.config.e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import type { Config } from 'jest';

import baseConfig from './jest.config';

const config: Config = {
...baseConfig,
testRegex: '.*\\.e2e-spec\\.ts$',
};

export default config;
2 changes: 1 addition & 1 deletion apps/server/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { Config } from 'jest';
const config: Config = {
verbose: true,
moduleFileExtensions: ['js', 'json', 'ts'],
rootDir: 'src',
rootDir: 'test',
testRegex: '.*\\.spec\\.ts$',
transform: {
'^.+\\.(t|j)s$': 'ts-jest',
Expand Down
5 changes: 3 additions & 2 deletions apps/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
"start:debug": "nest start --debug --watch",
"start:prod": "cross-env NODE_ENV=prod node dist/src/main",
"start:prod:pm": "cross-env NODE_ENV=prod pm2 start ecosystem.config.js",
"test": "pnpm test:unit && pnpm test:e2e",
"test": "pnpm test:e2e",
"test:unit": "cross-env NODE_ENV=test jest --config jest.config.ts",
"test:e2e": "cross-env NODE_ENV=test jest --config jest.config.e2e.ts",
"test:cov": "jest --coverage"
"test:cov": "vitest --coverage"
},
"dependencies": {
"@nestjs-modules/ioredis": "^2.0.1",
Expand Down Expand Up @@ -48,6 +48,7 @@
"cross-env": "^7.0.3",
"ioredis-mock": "^8.9.0",
"jest": "^29.5.0",
"jsdom": "^24.1.0",
"nodemon": "^3.1.4",
"source-map-support": "^0.5.21",
"supertest": "^6.3.3",
Expand Down
6 changes: 3 additions & 3 deletions apps/server/src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { RedisModule } from '@nestjs-modules/ioredis';
import { Module } from '@nestjs/common';
import { ScheduleModule } from '@nestjs/schedule';
import { GlobalModule } from 'src/global/global.module';
import { UserModule } from 'src/user/user.module';
import { AuthModule } from 'src/auth/auth.module';
import { GlobalModule } from '../global/global.module';
import { UserModule } from '../user/user.module';
import { AuthModule } from '../auth/auth.module';

@Module({
imports: [
Expand Down
170 changes: 0 additions & 170 deletions apps/server/test/app.e2e-spec.js

This file was deleted.

15 changes: 12 additions & 3 deletions apps/server/test/app.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Test, TestingModule } from '@nestjs/testing';
import { INestApplication } from '@nestjs/common';
import * as request from 'supertest';
import { AppModule } from './../src/app/app.module';
import { AppModule } from '../src/app/app.module';
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';

describe('AppController (e2e)', () => {
let app: INestApplication;
Expand All @@ -12,10 +13,18 @@ describe('AppController (e2e)', () => {
}).compile();

app = moduleFixture.createNestApplication();
const config = new DocumentBuilder()
.setTitle('PosterCraft Swagger')
.setDescription('The PosterCraft API description')
.setVersion('v1.0')
.addBearerAuth()
.build();
const document = SwaggerModule.createDocument(app, config);
SwaggerModule.setup('/swagger', app, document);
await app.init();
});

it('/ (GET)', () => {
return request(app.getHttpServer()).get('/').expect(200);
it('/swagger (GET)', () => {
return request(app.getHttpServer()).get('/swagger').expect(200);
});
});
9 changes: 0 additions & 9 deletions apps/server/test/jest-e2e.json

This file was deleted.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "Poster editor",
"type": "module",
"license": "MIT",
"packageManager": "pnpm@9.3.0",
"bugs": {
"url": "https://github.com/ileostar/PosterCraft/issues"
},
Expand All @@ -19,6 +20,7 @@
"dev:web": "pnpm -F web dev",
"dev:server": "pnpm -F server start",
"lint": "turbo lint --no-daemon",
"test": "turbo test --no-daemon",
"format": "prettier --write --cache .",
"format-check": "prettier --check --cache .",
"build": "pnpm schema:build && turbo build --no-daemon",
Expand All @@ -38,7 +40,6 @@
},
"devDependencies": {
"@ianvs/prettier-plugin-sort-imports": "^4.3.0",
"@poster-craft/tsconfig": "workspace:^",
"@types/node": "^20.14.9",
"conventional-changelog-cli": "^4.1.0",
"dotenv": "^16.4.5",
Expand All @@ -50,6 +51,7 @@
"tsup": "^8.1.0",
"tsx": "^4.16.2",
"turbo": "^2.0.6",
"typescript": "^5.5.3"
"typescript": "^5.5.3",
"vitest": "^2.0.2"
}
}
9 changes: 9 additions & 0 deletions packages/shared/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "shared",
"version": "1.0.0",
"description": "",
"main": "index.js",
"keywords": [],
"author": "",
"license": "ISC"
}
Empty file added packages/shared/src/.gitkeep
Empty file.
Empty file added packages/shared/test/.gitkeep
Empty file.
5 changes: 1 addition & 4 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{
"name": "@poster-craft/ui",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
}
"main": "index.js"
}
Loading

0 comments on commit 614421c

Please sign in to comment.