create-nest-minimum 0.0.39 → 0.0.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +59 -59
- package/dist/action.js +39 -44
- package/dist/messages.d.ts +1 -0
- package/dist/messages.js +2 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +2 -0
- package/index.cjs +3 -3
- package/package.json +6 -6
- package/template/README.md +60 -60
- package/template/_gitignore +17 -17
- package/template/nest-cli.json +13 -13
- package/template/package.json +38 -38
- package/template/src/app.controller.spec.ts +23 -23
- package/template/src/app.controller.ts +13 -13
- package/template/src/app.module.ts +11 -11
- package/template/src/app.service.ts +9 -9
- package/template/src/express.ts +12 -12
- package/template/src/fastify.ts +16 -16
- package/template/test/app.e2e-spec.ts +26 -26
- package/template/tsconfig.build.json +9 -9
- package/template/tsconfig.json +23 -23
- package/template/vitest-globals.d.ts +19 -19
- package/template/vitest.config.e2e.mts +12 -12
- package/template/vitest.config.mts +19 -19
package/index.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
require('./dist/index.js')
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
require('./dist/index.js')
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-nest-minimum",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.41",
|
|
4
4
|
"description": "A create nest minimum app cli tool.",
|
|
5
5
|
"author": "YanluPei",
|
|
6
6
|
"license": "MIT",
|
|
@@ -13,15 +13,15 @@
|
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@clack/prompts": "^0.11.0",
|
|
15
15
|
"ansis": "^4.2.0",
|
|
16
|
-
"commander": "^14.0.
|
|
16
|
+
"commander": "^14.0.2"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@release-it/conventional-changelog": "^10.0.
|
|
19
|
+
"@release-it/conventional-changelog": "^10.0.2",
|
|
20
20
|
"release-it-pnpm": "^4.6.6",
|
|
21
|
-
"@types/node": "^
|
|
22
|
-
"release-it": "^19.0.
|
|
21
|
+
"@types/node": "^24.10.1",
|
|
22
|
+
"release-it": "^19.0.6",
|
|
23
23
|
"typescript": "^5.9.3",
|
|
24
|
-
"vitest": "^
|
|
24
|
+
"vitest": "^4.0.15"
|
|
25
25
|
},
|
|
26
26
|
"private": false,
|
|
27
27
|
"engines": {
|
package/template/README.md
CHANGED
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
# $PACKAGE_NAME
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
$DESCRIPTION
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
## Project setup
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
$ $INSTALL
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Compile and run the project
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
# development
|
|
17
|
-
$ $RUN start
|
|
18
|
-
|
|
19
|
-
# watch mode
|
|
20
|
-
$ $RUN start:dev
|
|
21
|
-
|
|
22
|
-
# debug mode
|
|
23
|
-
$ $RUN start:debug
|
|
24
|
-
|
|
25
|
-
# production mode
|
|
26
|
-
$ $RUN start:prod
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
$START
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
## Run tests
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
# unit tests
|
|
36
|
-
$ $RUN test
|
|
37
|
-
|
|
38
|
-
# e2e tests
|
|
39
|
-
$ $RUN test:e2e
|
|
40
|
-
|
|
41
|
-
# test coverage
|
|
42
|
-
$ $RUN test:cov
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
$END
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
## Resources
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
Check out a few resources that may come in handy when working with NestJS:
|
|
52
|
-
|
|
53
|
-
- Visit the [NestJS Documentation](https://docs.nestjs.com) to learn more about the framework.
|
|
54
|
-
- For questions and support, please visit our [Discord channel](https://discord.gg/G7Qnnhy).
|
|
55
|
-
- To dive deeper and get more hands-on experience, check out our official video [courses](https://courses.nestjs.com/).
|
|
56
|
-
- Deploy your application to AWS with the help of [NestJS Mau](https://mau.nestjs.com) in just a few clicks.
|
|
57
|
-
- Visualize your application graph and interact with the NestJS application in real-time using [NestJS Devtools](https://devtools.nestjs.com).
|
|
58
|
-
- Need help with your project (part-time to full-time)? Check out our official [enterprise support](https://enterprise.nestjs.com).
|
|
59
|
-
- To stay in the loop and get updates, follow us on [X](https://x.com/nestframework) and [LinkedIn](https://linkedin.com/company/nestjs).
|
|
60
|
-
- Looking for a job, or have a job to offer? Check out our official [Jobs board](https://jobs.nestjs.com).
|
|
1
|
+
# $PACKAGE_NAME
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
$DESCRIPTION
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
## Project setup
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
$ $INSTALL
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Compile and run the project
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# development
|
|
17
|
+
$ $RUN start
|
|
18
|
+
|
|
19
|
+
# watch mode
|
|
20
|
+
$ $RUN start:dev
|
|
21
|
+
|
|
22
|
+
# debug mode
|
|
23
|
+
$ $RUN start:debug
|
|
24
|
+
|
|
25
|
+
# production mode
|
|
26
|
+
$ $RUN start:prod
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
$START
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
## Run tests
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
# unit tests
|
|
36
|
+
$ $RUN test
|
|
37
|
+
|
|
38
|
+
# e2e tests
|
|
39
|
+
$ $RUN test:e2e
|
|
40
|
+
|
|
41
|
+
# test coverage
|
|
42
|
+
$ $RUN test:cov
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
$END
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
## Resources
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
Check out a few resources that may come in handy when working with NestJS:
|
|
52
|
+
|
|
53
|
+
- Visit the [NestJS Documentation](https://docs.nestjs.com) to learn more about the framework.
|
|
54
|
+
- For questions and support, please visit our [Discord channel](https://discord.gg/G7Qnnhy).
|
|
55
|
+
- To dive deeper and get more hands-on experience, check out our official video [courses](https://courses.nestjs.com/).
|
|
56
|
+
- Deploy your application to AWS with the help of [NestJS Mau](https://mau.nestjs.com) in just a few clicks.
|
|
57
|
+
- Visualize your application graph and interact with the NestJS application in real-time using [NestJS Devtools](https://devtools.nestjs.com).
|
|
58
|
+
- Need help with your project (part-time to full-time)? Check out our official [enterprise support](https://enterprise.nestjs.com).
|
|
59
|
+
- To stay in the loop and get updates, follow us on [X](https://x.com/nestframework) and [LinkedIn](https://linkedin.com/company/nestjs).
|
|
60
|
+
- Looking for a job, or have a job to offer? Check out our official [Jobs board](https://jobs.nestjs.com).
|
package/template/_gitignore
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
# Logs
|
|
2
|
-
logs
|
|
3
|
-
*.log
|
|
4
|
-
npm-debug.log*
|
|
5
|
-
yarn-debug.log*
|
|
6
|
-
yarn-error.log*
|
|
7
|
-
pnpm-debug.log*
|
|
8
|
-
lerna-debug.log*
|
|
9
|
-
|
|
10
|
-
/node_modules
|
|
11
|
-
/dist
|
|
12
|
-
|
|
13
|
-
# Editor directories and files
|
|
14
|
-
.vscode/*
|
|
15
|
-
!.vscode/extensions.json
|
|
16
|
-
.idea
|
|
17
|
-
.DS_Store
|
|
1
|
+
# Logs
|
|
2
|
+
logs
|
|
3
|
+
*.log
|
|
4
|
+
npm-debug.log*
|
|
5
|
+
yarn-debug.log*
|
|
6
|
+
yarn-error.log*
|
|
7
|
+
pnpm-debug.log*
|
|
8
|
+
lerna-debug.log*
|
|
9
|
+
|
|
10
|
+
/node_modules
|
|
11
|
+
/dist
|
|
12
|
+
|
|
13
|
+
# Editor directories and files
|
|
14
|
+
.vscode/*
|
|
15
|
+
!.vscode/extensions.json
|
|
16
|
+
.idea
|
|
17
|
+
.DS_Store
|
package/template/nest-cli.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json.schemastore.org/nest-cli",
|
|
3
|
-
"collection": "@nestjs/schematics",
|
|
4
|
-
"sourceRoot": "src",
|
|
5
|
-
"generateOptions": {
|
|
6
|
-
"spec": false
|
|
7
|
-
},
|
|
8
|
-
"compilerOptions": {
|
|
9
|
-
"deleteOutDir": true,
|
|
10
|
-
"assets": [],
|
|
11
|
-
"tsConfigPath": "./tsconfig.build.json"
|
|
12
|
-
}
|
|
13
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/nest-cli",
|
|
3
|
+
"collection": "@nestjs/schematics",
|
|
4
|
+
"sourceRoot": "src",
|
|
5
|
+
"generateOptions": {
|
|
6
|
+
"spec": false
|
|
7
|
+
},
|
|
8
|
+
"compilerOptions": {
|
|
9
|
+
"deleteOutDir": true,
|
|
10
|
+
"assets": [],
|
|
11
|
+
"tsConfigPath": "./tsconfig.build.json"
|
|
12
|
+
}
|
|
13
|
+
}
|
package/template/package.json
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "nest-minimum-app-template",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"description": "A nest minimum app template.",
|
|
5
|
-
"private": true,
|
|
6
|
-
"main": "dist/main.js",
|
|
7
|
-
"type": "commonjs",
|
|
8
|
-
"scripts": {
|
|
9
|
-
"build": "nest build",
|
|
10
|
-
"start": "nest start",
|
|
11
|
-
"start:dev": "nest start --watch",
|
|
12
|
-
"start:debug": "nest start --debug --watch",
|
|
13
|
-
"start:prod": "node dist/main.js"
|
|
14
|
-
},
|
|
15
|
-
"dependencies": {
|
|
16
|
-
"@nestjs/common": "^11.1.
|
|
17
|
-
"@nestjs/core": "^11.1.
|
|
18
|
-
"@nestjs/platform-express": "^11.1.
|
|
19
|
-
"@nestjs/platform-fastify": "^11.1.
|
|
20
|
-
"reflect-metadata": "^0.2.2"
|
|
21
|
-
},
|
|
22
|
-
"devDependencies": {
|
|
23
|
-
"@nestjs/cli": "^11.0.
|
|
24
|
-
"@nestjs/testing": "^11.1.
|
|
25
|
-
"@swc/cli": "^0.7.
|
|
26
|
-
"@swc/core": "^1.
|
|
27
|
-
"@types/node": "^
|
|
28
|
-
"@types/supertest": "^6.0.3",
|
|
29
|
-
"@vitest/coverage-v8": "^
|
|
30
|
-
"supertest": "^7.1.4",
|
|
31
|
-
"typescript": "^5.9.3",
|
|
32
|
-
"unplugin-swc": "^1.5.
|
|
33
|
-
"vitest": "^
|
|
34
|
-
},
|
|
35
|
-
"engines": {
|
|
36
|
-
"node": ">=20"
|
|
37
|
-
}
|
|
38
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "nest-minimum-app-template",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "A nest minimum app template.",
|
|
5
|
+
"private": true,
|
|
6
|
+
"main": "dist/main.js",
|
|
7
|
+
"type": "commonjs",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "nest build",
|
|
10
|
+
"start": "nest start",
|
|
11
|
+
"start:dev": "nest start --watch",
|
|
12
|
+
"start:debug": "nest start --debug --watch",
|
|
13
|
+
"start:prod": "node dist/main.js"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@nestjs/common": "^11.1.9",
|
|
17
|
+
"@nestjs/core": "^11.1.9",
|
|
18
|
+
"@nestjs/platform-express": "^11.1.9",
|
|
19
|
+
"@nestjs/platform-fastify": "^11.1.9",
|
|
20
|
+
"reflect-metadata": "^0.2.2"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@nestjs/cli": "^11.0.14",
|
|
24
|
+
"@nestjs/testing": "^11.1.9",
|
|
25
|
+
"@swc/cli": "^0.7.9",
|
|
26
|
+
"@swc/core": "^1.15.3",
|
|
27
|
+
"@types/node": "^24.10.1",
|
|
28
|
+
"@types/supertest": "^6.0.3",
|
|
29
|
+
"@vitest/coverage-v8": "^4.0.15",
|
|
30
|
+
"supertest": "^7.1.4",
|
|
31
|
+
"typescript": "^5.9.3",
|
|
32
|
+
"unplugin-swc": "^1.5.9",
|
|
33
|
+
"vitest": "^4.0.15"
|
|
34
|
+
},
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": ">=20.19.6"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { Test, TestingModule } from '@nestjs/testing'
|
|
2
|
-
import { AppController } from './app.controller'
|
|
3
|
-
import { AppService } from './app.service'
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
describe('AppController', () => {
|
|
7
|
-
let appController: AppController
|
|
8
|
-
|
|
9
|
-
beforeEach(async () => {
|
|
10
|
-
const app: TestingModule = await Test.createTestingModule({
|
|
11
|
-
controllers: [ AppController ],
|
|
12
|
-
providers: [ AppService ],
|
|
13
|
-
}).compile()
|
|
14
|
-
|
|
15
|
-
appController = app.get<AppController>(AppController)
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
describe('root', () => {
|
|
19
|
-
it('should return "Hello World!"', () => {
|
|
20
|
-
expect(appController.getHello()).toBe('Hello World!')
|
|
21
|
-
})
|
|
22
|
-
})
|
|
23
|
-
})
|
|
1
|
+
import { Test, TestingModule } from '@nestjs/testing'
|
|
2
|
+
import { AppController } from './app.controller'
|
|
3
|
+
import { AppService } from './app.service'
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
describe('AppController', () => {
|
|
7
|
+
let appController: AppController
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
const app: TestingModule = await Test.createTestingModule({
|
|
11
|
+
controllers: [ AppController ],
|
|
12
|
+
providers: [ AppService ],
|
|
13
|
+
}).compile()
|
|
14
|
+
|
|
15
|
+
appController = app.get<AppController>(AppController)
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
describe('root', () => {
|
|
19
|
+
it('should return "Hello World!"', () => {
|
|
20
|
+
expect(appController.getHello()).toBe('Hello World!')
|
|
21
|
+
})
|
|
22
|
+
})
|
|
23
|
+
})
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Controller, Get } from '@nestjs/common'
|
|
2
|
-
import { AppService } from './app.service'
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
@Controller()
|
|
6
|
-
export class AppController {
|
|
7
|
-
constructor(private readonly appService: AppService) {}
|
|
8
|
-
|
|
9
|
-
@Get()
|
|
10
|
-
getHello() {
|
|
11
|
-
return this.appService.getHello()
|
|
12
|
-
}
|
|
13
|
-
}
|
|
1
|
+
import { Controller, Get } from '@nestjs/common'
|
|
2
|
+
import { AppService } from './app.service'
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
@Controller()
|
|
6
|
+
export class AppController {
|
|
7
|
+
constructor(private readonly appService: AppService) {}
|
|
8
|
+
|
|
9
|
+
@Get()
|
|
10
|
+
getHello() {
|
|
11
|
+
return this.appService.getHello()
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Module } from '@nestjs/common'
|
|
2
|
-
import { AppController } from './app.controller'
|
|
3
|
-
import { AppService } from './app.service'
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
@Module({
|
|
7
|
-
imports: [],
|
|
8
|
-
controllers: [ AppController ],
|
|
9
|
-
providers: [ AppService ],
|
|
10
|
-
})
|
|
11
|
-
export class AppModule {}
|
|
1
|
+
import { Module } from '@nestjs/common'
|
|
2
|
+
import { AppController } from './app.controller'
|
|
3
|
+
import { AppService } from './app.service'
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
@Module({
|
|
7
|
+
imports: [],
|
|
8
|
+
controllers: [ AppController ],
|
|
9
|
+
providers: [ AppService ],
|
|
10
|
+
})
|
|
11
|
+
export class AppModule {}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Injectable } from '@nestjs/common'
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
@Injectable()
|
|
5
|
-
export class AppService {
|
|
6
|
-
getHello() {
|
|
7
|
-
return 'Hello World!'
|
|
8
|
-
}
|
|
9
|
-
}
|
|
1
|
+
import { Injectable } from '@nestjs/common'
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
@Injectable()
|
|
5
|
+
export class AppService {
|
|
6
|
+
getHello() {
|
|
7
|
+
return 'Hello World!'
|
|
8
|
+
}
|
|
9
|
+
}
|
package/template/src/express.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { NestFactory } from '@nestjs/core'
|
|
2
|
-
import { AppModule } from './app.module'
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const bootstrap = async (port: number | string) => {
|
|
6
|
-
const app = await NestFactory.create(AppModule)
|
|
7
|
-
await app.listen(port)
|
|
8
|
-
|
|
9
|
-
console.log(`\nApplication is running on: ${ await app.getUrl() }`)
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
bootstrap(process.env.PORT ?? 3000).catch(console.error)
|
|
1
|
+
import { NestFactory } from '@nestjs/core'
|
|
2
|
+
import { AppModule } from './app.module'
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
const bootstrap = async (port: number | string) => {
|
|
6
|
+
const app = await NestFactory.create(AppModule)
|
|
7
|
+
await app.listen(port)
|
|
8
|
+
|
|
9
|
+
console.log(`\nApplication is running on: ${ await app.getUrl() }`)
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
bootstrap(process.env.PORT ?? 3000).catch(console.error)
|
package/template/src/fastify.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { NestFactory } from '@nestjs/core'
|
|
2
|
-
import { FastifyAdapter, NestFastifyApplication } from '@nestjs/platform-fastify'
|
|
3
|
-
import { AppModule } from './app.module'
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const bootstrap = async (port: number | string) => {
|
|
7
|
-
const app = await NestFactory.create<NestFastifyApplication>(
|
|
8
|
-
AppModule,
|
|
9
|
-
new FastifyAdapter(),
|
|
10
|
-
)
|
|
11
|
-
await app.listen(port)
|
|
12
|
-
|
|
13
|
-
console.log(`\nApplication is running on: ${ await app.getUrl() }`)
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
bootstrap(process.env.PORT ?? 3000).catch(console.error)
|
|
1
|
+
import { NestFactory } from '@nestjs/core'
|
|
2
|
+
import { FastifyAdapter, NestFastifyApplication } from '@nestjs/platform-fastify'
|
|
3
|
+
import { AppModule } from './app.module'
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
const bootstrap = async (port: number | string) => {
|
|
7
|
+
const app = await NestFactory.create<NestFastifyApplication>(
|
|
8
|
+
AppModule,
|
|
9
|
+
new FastifyAdapter(),
|
|
10
|
+
)
|
|
11
|
+
await app.listen(port)
|
|
12
|
+
|
|
13
|
+
console.log(`\nApplication is running on: ${ await app.getUrl() }`)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
bootstrap(process.env.PORT ?? 3000).catch(console.error)
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { INestApplication } from '@nestjs/common'
|
|
2
|
-
import { Test, TestingModule } from '@nestjs/testing'
|
|
3
|
-
import request from 'supertest'
|
|
4
|
-
import { App } from 'supertest/types'
|
|
5
|
-
import { AppModule } from '../src/app.module'
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
describe('AppController (e2e)', () => {
|
|
9
|
-
let app: INestApplication<App>
|
|
10
|
-
|
|
11
|
-
beforeEach(async () => {
|
|
12
|
-
const moduleFixture: TestingModule = await Test.createTestingModule({
|
|
13
|
-
imports: [ AppModule ],
|
|
14
|
-
}).compile()
|
|
15
|
-
|
|
16
|
-
app = moduleFixture.createNestApplication()
|
|
17
|
-
await app.init()
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
it('/ (GET)', () => {
|
|
21
|
-
return request(app.getHttpServer())
|
|
22
|
-
.get('/')
|
|
23
|
-
.expect(200)
|
|
24
|
-
.expect('Hello World!')
|
|
25
|
-
})
|
|
26
|
-
})
|
|
1
|
+
import { INestApplication } from '@nestjs/common'
|
|
2
|
+
import { Test, TestingModule } from '@nestjs/testing'
|
|
3
|
+
import request from 'supertest'
|
|
4
|
+
import { App } from 'supertest/types'
|
|
5
|
+
import { AppModule } from '../src/app.module'
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
describe('AppController (e2e)', () => {
|
|
9
|
+
let app: INestApplication<App>
|
|
10
|
+
|
|
11
|
+
beforeEach(async () => {
|
|
12
|
+
const moduleFixture: TestingModule = await Test.createTestingModule({
|
|
13
|
+
imports: [ AppModule ],
|
|
14
|
+
}).compile()
|
|
15
|
+
|
|
16
|
+
app = moduleFixture.createNestApplication()
|
|
17
|
+
await app.init()
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
it('/ (GET)', () => {
|
|
21
|
+
return request(app.getHttpServer())
|
|
22
|
+
.get('/')
|
|
23
|
+
.expect(200)
|
|
24
|
+
.expect('Hello World!')
|
|
25
|
+
})
|
|
26
|
+
})
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "./tsconfig.json",
|
|
3
|
-
"exclude": [
|
|
4
|
-
"node_modules",
|
|
5
|
-
"test",
|
|
6
|
-
"dist",
|
|
7
|
-
"**/*spec.ts"
|
|
8
|
-
]
|
|
9
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"extends": "./tsconfig.json",
|
|
3
|
+
"exclude": [
|
|
4
|
+
"node_modules",
|
|
5
|
+
"test",
|
|
6
|
+
"dist",
|
|
7
|
+
"**/*spec.ts"
|
|
8
|
+
]
|
|
9
|
+
}
|
package/template/tsconfig.json
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"module": "CommonJS",
|
|
4
|
-
"declaration": true,
|
|
5
|
-
"removeComments": true,
|
|
6
|
-
"emitDecoratorMetadata": true,
|
|
7
|
-
"experimentalDecorators": true,
|
|
8
|
-
"allowSyntheticDefaultImports": true,
|
|
9
|
-
"target": "ESNext",
|
|
10
|
-
"sourceMap": false,
|
|
11
|
-
"outDir": "./dist",
|
|
12
|
-
"baseUrl": "./",
|
|
13
|
-
"incremental": true,
|
|
14
|
-
"skipLibCheck": true,
|
|
15
|
-
"strictNullChecks": true,
|
|
16
|
-
"forceConsistentCasingInFileNames": true,
|
|
17
|
-
"noImplicitAny": false,
|
|
18
|
-
"strictBindCallApply": false,
|
|
19
|
-
"noFallthroughCasesInSwitch": false,
|
|
20
|
-
"moduleResolution": "node",
|
|
21
|
-
"esModuleInterop": true
|
|
22
|
-
}
|
|
23
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"module": "CommonJS",
|
|
4
|
+
"declaration": true,
|
|
5
|
+
"removeComments": true,
|
|
6
|
+
"emitDecoratorMetadata": true,
|
|
7
|
+
"experimentalDecorators": true,
|
|
8
|
+
"allowSyntheticDefaultImports": true,
|
|
9
|
+
"target": "ESNext",
|
|
10
|
+
"sourceMap": false,
|
|
11
|
+
"outDir": "./dist",
|
|
12
|
+
"baseUrl": "./",
|
|
13
|
+
"incremental": true,
|
|
14
|
+
"skipLibCheck": true,
|
|
15
|
+
"strictNullChecks": true,
|
|
16
|
+
"forceConsistentCasingInFileNames": true,
|
|
17
|
+
"noImplicitAny": false,
|
|
18
|
+
"strictBindCallApply": false,
|
|
19
|
+
"noFallthroughCasesInSwitch": false,
|
|
20
|
+
"moduleResolution": "node",
|
|
21
|
+
"esModuleInterop": true
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
declare global {
|
|
2
|
-
const suite: typeof import('vitest')['suite']
|
|
3
|
-
const test: typeof import('vitest')['test']
|
|
4
|
-
const describe: typeof import('vitest')['describe']
|
|
5
|
-
const it: typeof import('vitest')['it']
|
|
6
|
-
const expectTypeOf: typeof import('vitest')['expectTypeOf']
|
|
7
|
-
const assertType: typeof import('vitest')['assertType']
|
|
8
|
-
const expect: typeof import('vitest')['expect']
|
|
9
|
-
const assert: typeof import('vitest')['assert']
|
|
10
|
-
const vitest: typeof import('vitest')['vitest']
|
|
11
|
-
const vi: typeof import('vitest')['vitest']
|
|
12
|
-
const beforeAll: typeof import('vitest')['beforeAll']
|
|
13
|
-
const afterAll: typeof import('vitest')['afterAll']
|
|
14
|
-
const beforeEach: typeof import('vitest')['beforeEach']
|
|
15
|
-
const afterEach: typeof import('vitest')['afterEach']
|
|
16
|
-
const onTestFailed: typeof import('vitest')['onTestFailed']
|
|
17
|
-
const onTestFinished: typeof import('vitest')['onTestFinished']
|
|
18
|
-
}
|
|
19
|
-
export {}
|
|
1
|
+
declare global {
|
|
2
|
+
const suite: typeof import('vitest')['suite']
|
|
3
|
+
const test: typeof import('vitest')['test']
|
|
4
|
+
const describe: typeof import('vitest')['describe']
|
|
5
|
+
const it: typeof import('vitest')['it']
|
|
6
|
+
const expectTypeOf: typeof import('vitest')['expectTypeOf']
|
|
7
|
+
const assertType: typeof import('vitest')['assertType']
|
|
8
|
+
const expect: typeof import('vitest')['expect']
|
|
9
|
+
const assert: typeof import('vitest')['assert']
|
|
10
|
+
const vitest: typeof import('vitest')['vitest']
|
|
11
|
+
const vi: typeof import('vitest')['vitest']
|
|
12
|
+
const beforeAll: typeof import('vitest')['beforeAll']
|
|
13
|
+
const afterAll: typeof import('vitest')['afterAll']
|
|
14
|
+
const beforeEach: typeof import('vitest')['beforeEach']
|
|
15
|
+
const afterEach: typeof import('vitest')['afterEach']
|
|
16
|
+
const onTestFailed: typeof import('vitest')['onTestFailed']
|
|
17
|
+
const onTestFinished: typeof import('vitest')['onTestFinished']
|
|
18
|
+
}
|
|
19
|
+
export {}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineConfig, mergeConfig } from 'vitest/config'
|
|
2
|
-
import vitestConfig from './vitest.config.mjs'
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export default mergeConfig(
|
|
6
|
-
vitestConfig,
|
|
7
|
-
defineConfig({
|
|
8
|
-
test: {
|
|
9
|
-
include: [ '**/*.e2e-spec.ts' ],
|
|
10
|
-
},
|
|
11
|
-
}),
|
|
12
|
-
)
|
|
1
|
+
import { defineConfig, mergeConfig } from 'vitest/config'
|
|
2
|
+
import vitestConfig from './vitest.config.mjs'
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export default mergeConfig(
|
|
6
|
+
vitestConfig,
|
|
7
|
+
defineConfig({
|
|
8
|
+
test: {
|
|
9
|
+
include: [ '**/*.e2e-spec.ts' ],
|
|
10
|
+
},
|
|
11
|
+
}),
|
|
12
|
+
)
|