wip nest course
This commit is contained in:
25
tests_hugo/nest_app/.eslintrc.js
Normal file
25
tests_hugo/nest_app/.eslintrc.js
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
module.exports = {
|
||||||
|
parser: '@typescript-eslint/parser',
|
||||||
|
parserOptions: {
|
||||||
|
project: 'tsconfig.json',
|
||||||
|
tsconfigRootDir : __dirname,
|
||||||
|
sourceType: 'module',
|
||||||
|
},
|
||||||
|
plugins: ['@typescript-eslint/eslint-plugin'],
|
||||||
|
extends: [
|
||||||
|
'plugin:@typescript-eslint/recommended',
|
||||||
|
'plugin:prettier/recommended',
|
||||||
|
],
|
||||||
|
root: true,
|
||||||
|
env: {
|
||||||
|
node: true,
|
||||||
|
jest: true,
|
||||||
|
},
|
||||||
|
ignorePatterns: ['.eslintrc.js'],
|
||||||
|
rules: {
|
||||||
|
'@typescript-eslint/interface-name-prefix': 'off',
|
||||||
|
'@typescript-eslint/explicit-function-return-type': 'off',
|
||||||
|
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
||||||
|
'@typescript-eslint/no-explicit-any': 'off',
|
||||||
|
},
|
||||||
|
};
|
||||||
4
tests_hugo/nest_app/.prettierrc
Normal file
4
tests_hugo/nest_app/.prettierrc
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"singleQuote": true,
|
||||||
|
"trailingComma": "all"
|
||||||
|
}
|
||||||
73
tests_hugo/nest_app/README.md
Normal file
73
tests_hugo/nest_app/README.md
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
<p align="center">
|
||||||
|
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="200" alt="Nest Logo" /></a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456
|
||||||
|
[circleci-url]: https://circleci.com/gh/nestjs/nest
|
||||||
|
|
||||||
|
<p align="center">A progressive <a href="http://nodejs.org" target="_blank">Node.js</a> framework for building efficient and scalable server-side applications.</p>
|
||||||
|
<p align="center">
|
||||||
|
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a>
|
||||||
|
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a>
|
||||||
|
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/dm/@nestjs/common.svg" alt="NPM Downloads" /></a>
|
||||||
|
<a href="https://circleci.com/gh/nestjs/nest" target="_blank"><img src="https://img.shields.io/circleci/build/github/nestjs/nest/master" alt="CircleCI" /></a>
|
||||||
|
<a href="https://coveralls.io/github/nestjs/nest?branch=master" target="_blank"><img src="https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#9" alt="Coverage" /></a>
|
||||||
|
<a href="https://discord.gg/G7Qnnhy" target="_blank"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a>
|
||||||
|
<a href="https://opencollective.com/nest#backer" target="_blank"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a>
|
||||||
|
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a>
|
||||||
|
<a href="https://paypal.me/kamilmysliwiec" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg"/></a>
|
||||||
|
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://img.shields.io/badge/Support%20us-Open%20Collective-41B883.svg" alt="Support us"></a>
|
||||||
|
<a href="https://twitter.com/nestframework" target="_blank"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow"></a>
|
||||||
|
</p>
|
||||||
|
<!--[](https://opencollective.com/nest#backer)
|
||||||
|
[](https://opencollective.com/nest#sponsor)-->
|
||||||
|
|
||||||
|
## Description
|
||||||
|
|
||||||
|
[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ npm install
|
||||||
|
```
|
||||||
|
|
||||||
|
## Running the app
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# development
|
||||||
|
$ npm run start
|
||||||
|
|
||||||
|
# watch mode
|
||||||
|
$ npm run start:dev
|
||||||
|
|
||||||
|
# production mode
|
||||||
|
$ npm run start:prod
|
||||||
|
```
|
||||||
|
|
||||||
|
## Test
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# unit tests
|
||||||
|
$ npm run test
|
||||||
|
|
||||||
|
# e2e tests
|
||||||
|
$ npm run test:e2e
|
||||||
|
|
||||||
|
# test coverage
|
||||||
|
$ npm run test:cov
|
||||||
|
```
|
||||||
|
|
||||||
|
## Support
|
||||||
|
|
||||||
|
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).
|
||||||
|
|
||||||
|
## Stay in touch
|
||||||
|
|
||||||
|
- Author - [Kamil Myśliwiec](https://kamilmysliwiec.com)
|
||||||
|
- Website - [https://nestjs.com](https://nestjs.com/)
|
||||||
|
- Twitter - [@nestframework](https://twitter.com/nestframework)
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
Nest is [MIT licensed](LICENSE).
|
||||||
6
tests_hugo/nest_app/dist/app.controller.d.ts
vendored
Normal file
6
tests_hugo/nest_app/dist/app.controller.d.ts
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
import { AppService } from './app.service';
|
||||||
|
export declare class AppController {
|
||||||
|
private readonly appService;
|
||||||
|
constructor(appService: AppService);
|
||||||
|
getHello(): string;
|
||||||
|
}
|
||||||
34
tests_hugo/nest_app/dist/app.controller.js
vendored
Normal file
34
tests_hugo/nest_app/dist/app.controller.js
vendored
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
"use strict";
|
||||||
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||||
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||||
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||||
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||||
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||||
|
};
|
||||||
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||||
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.AppController = void 0;
|
||||||
|
const common_1 = require("@nestjs/common");
|
||||||
|
const app_service_1 = require("./app.service");
|
||||||
|
let AppController = class AppController {
|
||||||
|
constructor(appService) {
|
||||||
|
this.appService = appService;
|
||||||
|
}
|
||||||
|
getHello() {
|
||||||
|
return this.appService.getHello();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
__decorate([
|
||||||
|
(0, common_1.Get)(),
|
||||||
|
__metadata("design:type", Function),
|
||||||
|
__metadata("design:paramtypes", []),
|
||||||
|
__metadata("design:returntype", String)
|
||||||
|
], AppController.prototype, "getHello", null);
|
||||||
|
AppController = __decorate([
|
||||||
|
(0, common_1.Controller)(),
|
||||||
|
__metadata("design:paramtypes", [app_service_1.AppService])
|
||||||
|
], AppController);
|
||||||
|
exports.AppController = AppController;
|
||||||
|
//# sourceMappingURL=app.controller.js.map
|
||||||
1
tests_hugo/nest_app/dist/app.controller.js.map
vendored
Normal file
1
tests_hugo/nest_app/dist/app.controller.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"app.controller.js","sourceRoot":"","sources":["../src/app.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAiD;AACjD,+CAA2C;AAGpC,IAAM,aAAa,GAAnB,MAAM,aAAa;IACxB,YAA6B,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;IAAG,CAAC;IAGvD,QAAQ;QACN,OAAO,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;IACpC,CAAC;CACF,CAAA;AAJC;IAAC,IAAA,YAAG,GAAE;;;;6CAGL;AANU,aAAa;IADzB,IAAA,mBAAU,GAAE;qCAE8B,wBAAU;GADxC,aAAa,CAOzB;AAPY,sCAAa"}
|
||||||
2
tests_hugo/nest_app/dist/app.module.d.ts
vendored
Normal file
2
tests_hugo/nest_app/dist/app.module.d.ts
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
export declare class AppModule {
|
||||||
|
}
|
||||||
24
tests_hugo/nest_app/dist/app.module.js
vendored
Normal file
24
tests_hugo/nest_app/dist/app.module.js
vendored
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
"use strict";
|
||||||
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||||
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||||
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||||
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||||
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.AppModule = void 0;
|
||||||
|
const common_1 = require("@nestjs/common");
|
||||||
|
const app_controller_1 = require("./app.controller");
|
||||||
|
const app_service_1 = require("./app.service");
|
||||||
|
const coffees_controller_1 = require("./coffees/coffees.controller");
|
||||||
|
let AppModule = class AppModule {
|
||||||
|
};
|
||||||
|
AppModule = __decorate([
|
||||||
|
(0, common_1.Module)({
|
||||||
|
imports: [],
|
||||||
|
controllers: [app_controller_1.AppController, coffees_controller_1.CoffeesController],
|
||||||
|
providers: [app_service_1.AppService],
|
||||||
|
})
|
||||||
|
], AppModule);
|
||||||
|
exports.AppModule = AppModule;
|
||||||
|
//# sourceMappingURL=app.module.js.map
|
||||||
1
tests_hugo/nest_app/dist/app.module.js.map
vendored
Normal file
1
tests_hugo/nest_app/dist/app.module.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"app.module.js","sourceRoot":"","sources":["../src/app.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,qDAAiD;AACjD,+CAA2C;AAC3C,qEAAiE;AAO1D,IAAM,SAAS,GAAf,MAAM,SAAS;CAAG,CAAA;AAAZ,SAAS;IALrB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,CAAC,8BAAa,EAAE,sCAAiB,CAAC;QAC/C,SAAS,EAAE,CAAC,wBAAU,CAAC;KACxB,CAAC;GACW,SAAS,CAAG;AAAZ,8BAAS"}
|
||||||
3
tests_hugo/nest_app/dist/app.service.d.ts
vendored
Normal file
3
tests_hugo/nest_app/dist/app.service.d.ts
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
export declare class AppService {
|
||||||
|
getHello(): string;
|
||||||
|
}
|
||||||
20
tests_hugo/nest_app/dist/app.service.js
vendored
Normal file
20
tests_hugo/nest_app/dist/app.service.js
vendored
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
"use strict";
|
||||||
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||||
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||||
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||||
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||||
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.AppService = void 0;
|
||||||
|
const common_1 = require("@nestjs/common");
|
||||||
|
let AppService = class AppService {
|
||||||
|
getHello() {
|
||||||
|
return 'Hello nest!';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
AppService = __decorate([
|
||||||
|
(0, common_1.Injectable)()
|
||||||
|
], AppService);
|
||||||
|
exports.AppService = AppService;
|
||||||
|
//# sourceMappingURL=app.service.js.map
|
||||||
1
tests_hugo/nest_app/dist/app.service.js.map
vendored
Normal file
1
tests_hugo/nest_app/dist/app.service.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"app.service.js","sourceRoot":"","sources":["../src/app.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAGrC,IAAM,UAAU,GAAhB,MAAM,UAAU;IACrB,QAAQ;QACN,OAAO,aAAa,CAAC;IACvB,CAAC;CACF,CAAA;AAJY,UAAU;IADtB,IAAA,mBAAU,GAAE;GACA,UAAU,CAItB;AAJY,gCAAU"}
|
||||||
8
tests_hugo/nest_app/dist/coffees/coffees.controller.d.ts
vendored
Normal file
8
tests_hugo/nest_app/dist/coffees/coffees.controller.d.ts
vendored
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
export declare class CoffeesController {
|
||||||
|
findAll(paginationQuery: any): string;
|
||||||
|
findFlavors(): string;
|
||||||
|
findOne(id: string): string;
|
||||||
|
create(body: any): any;
|
||||||
|
update(id: string, body: any): string;
|
||||||
|
remove(id: string): string;
|
||||||
|
}
|
||||||
88
tests_hugo/nest_app/dist/coffees/coffees.controller.js
vendored
Normal file
88
tests_hugo/nest_app/dist/coffees/coffees.controller.js
vendored
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
"use strict";
|
||||||
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||||
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||||
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||||
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||||
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||||
|
};
|
||||||
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||||
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||||
|
};
|
||||||
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
||||||
|
return function (target, key) { decorator(target, key, paramIndex); }
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.CoffeesController = void 0;
|
||||||
|
const common_1 = require("@nestjs/common");
|
||||||
|
let CoffeesController = class CoffeesController {
|
||||||
|
findAll(paginationQuery) {
|
||||||
|
const { limit, offset } = paginationQuery;
|
||||||
|
return `this action returns all the coffees.
|
||||||
|
limit: ${limit},
|
||||||
|
offset: ${offset}
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
findFlavors() {
|
||||||
|
return 'this action returns the coffees flavors';
|
||||||
|
}
|
||||||
|
findOne(id) {
|
||||||
|
return `this action returns #${id} coffees`;
|
||||||
|
}
|
||||||
|
create(body) {
|
||||||
|
return body;
|
||||||
|
}
|
||||||
|
update(id, body) {
|
||||||
|
return `this action updates #${id} coffee`;
|
||||||
|
}
|
||||||
|
remove(id) {
|
||||||
|
return `this action removes #${id} coffee`;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
__decorate([
|
||||||
|
(0, common_1.Get)(),
|
||||||
|
__param(0, (0, common_1.Query)()),
|
||||||
|
__metadata("design:type", Function),
|
||||||
|
__metadata("design:paramtypes", [Object]),
|
||||||
|
__metadata("design:returntype", void 0)
|
||||||
|
], CoffeesController.prototype, "findAll", null);
|
||||||
|
__decorate([
|
||||||
|
(0, common_1.Get)('flavors'),
|
||||||
|
__metadata("design:type", Function),
|
||||||
|
__metadata("design:paramtypes", []),
|
||||||
|
__metadata("design:returntype", void 0)
|
||||||
|
], CoffeesController.prototype, "findFlavors", null);
|
||||||
|
__decorate([
|
||||||
|
(0, common_1.Get)(':id'),
|
||||||
|
__param(0, (0, common_1.Param)('id')),
|
||||||
|
__metadata("design:type", Function),
|
||||||
|
__metadata("design:paramtypes", [String]),
|
||||||
|
__metadata("design:returntype", void 0)
|
||||||
|
], CoffeesController.prototype, "findOne", null);
|
||||||
|
__decorate([
|
||||||
|
(0, common_1.Post)(),
|
||||||
|
(0, common_1.HttpCode)(common_1.HttpStatus.GONE),
|
||||||
|
__param(0, (0, common_1.Body)()),
|
||||||
|
__metadata("design:type", Function),
|
||||||
|
__metadata("design:paramtypes", [Object]),
|
||||||
|
__metadata("design:returntype", void 0)
|
||||||
|
], CoffeesController.prototype, "create", null);
|
||||||
|
__decorate([
|
||||||
|
(0, common_1.Patch)(':id'),
|
||||||
|
__param(0, (0, common_1.Param)('id')),
|
||||||
|
__param(1, (0, common_1.Body)()),
|
||||||
|
__metadata("design:type", Function),
|
||||||
|
__metadata("design:paramtypes", [String, Object]),
|
||||||
|
__metadata("design:returntype", void 0)
|
||||||
|
], CoffeesController.prototype, "update", null);
|
||||||
|
__decorate([
|
||||||
|
(0, common_1.Delete)(':id'),
|
||||||
|
__param(0, (0, common_1.Param)('id')),
|
||||||
|
__metadata("design:type", Function),
|
||||||
|
__metadata("design:paramtypes", [String]),
|
||||||
|
__metadata("design:returntype", void 0)
|
||||||
|
], CoffeesController.prototype, "remove", null);
|
||||||
|
CoffeesController = __decorate([
|
||||||
|
(0, common_1.Controller)('coffees')
|
||||||
|
], CoffeesController);
|
||||||
|
exports.CoffeesController = CoffeesController;
|
||||||
|
//# sourceMappingURL=coffees.controller.js.map
|
||||||
1
tests_hugo/nest_app/dist/coffees/coffees.controller.js.map
vendored
Normal file
1
tests_hugo/nest_app/dist/coffees/coffees.controller.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"coffees.controller.js","sourceRoot":"","sources":["../../src/coffees/coffees.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAWwB;AAGjB,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAG7B,OAAO,CAAU,eAAe;QAC/B,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,eAAe,CAAC;QAC1C,OAAO;aACI,KAAK;cACJ,MAAM;GACjB,CAAC;IACH,CAAC;IAGD,WAAW;QACV,OAAO,yCAAyC,CAAC;IAClD,CAAC;IAGD,OAAO,CAAc,EAAU;QAC9B,OAAO,wBAAwB,EAAE,UAAU,CAAC;IAC7C,CAAC;IAID,MAAM,CAAS,IAAI;QAClB,OAAO,IAAI,CAAC;IACb,CAAC;IAGD,MAAM,CAAc,EAAU,EAAU,IAAI;QAC3C,OAAO,wBAAwB,EAAE,SAAS,CAAC;IAC5C,CAAC;IAGD,MAAM,CAAc,EAAU;QAC7B,OAAO,wBAAwB,EAAE,SAAS,CAAC;IAC5C,CAAC;CACD,CAAA;AAlCA;IAAC,IAAA,YAAG,GAAE;IACG,WAAA,IAAA,cAAK,GAAE,CAAA;;;;gDAMf;AAED;IAAC,IAAA,YAAG,EAAC,SAAS,CAAC;;;;oDAGd;AAED;IAAC,IAAA,YAAG,EAAC,KAAK,CAAC;IACF,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;;gDAEnB;AAED;IAAC,IAAA,aAAI,GAAE;IACN,IAAA,iBAAQ,EAAC,mBAAU,CAAC,IAAI,CAAC;IAClB,WAAA,IAAA,aAAI,GAAE,CAAA;;;;+CAEb;AAED;IAAC,IAAA,cAAK,EAAC,KAAK,CAAC;IACL,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;IAAc,WAAA,IAAA,aAAI,GAAE,CAAA;;;;+CAEtC;AAED;IAAC,IAAA,eAAM,EAAC,KAAK,CAAC;IACN,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;;+CAElB;AAnCW,iBAAiB;IAD7B,IAAA,mBAAU,EAAC,SAAS,CAAC;GACT,iBAAiB,CAoC7B;AApCY,8CAAiB"}
|
||||||
1
tests_hugo/nest_app/dist/main.d.ts
vendored
Normal file
1
tests_hugo/nest_app/dist/main.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export {};
|
||||||
10
tests_hugo/nest_app/dist/main.js
vendored
Normal file
10
tests_hugo/nest_app/dist/main.js
vendored
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
const core_1 = require("@nestjs/core");
|
||||||
|
const app_module_1 = require("./app.module");
|
||||||
|
async function bootstrap() {
|
||||||
|
const app = await core_1.NestFactory.create(app_module_1.AppModule);
|
||||||
|
await app.listen(3000);
|
||||||
|
}
|
||||||
|
bootstrap();
|
||||||
|
//# sourceMappingURL=main.js.map
|
||||||
1
tests_hugo/nest_app/dist/main.js.map
vendored
Normal file
1
tests_hugo/nest_app/dist/main.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";;AAAA,uCAA2C;AAC3C,6CAAyC;AAEzC,KAAK,UAAU,SAAS;IACtB,MAAM,GAAG,GAAG,MAAM,kBAAW,CAAC,MAAM,CAAC,sBAAS,CAAC,CAAC;IAChD,MAAM,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACzB,CAAC;AACD,SAAS,EAAE,CAAC"}
|
||||||
1
tests_hugo/nest_app/dist/tsconfig.build.tsbuildinfo
vendored
Normal file
1
tests_hugo/nest_app/dist/tsconfig.build.tsbuildinfo
vendored
Normal file
File diff suppressed because one or more lines are too long
5
tests_hugo/nest_app/nest-cli.json
Normal file
5
tests_hugo/nest_app/nest-cli.json
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://json.schemastore.org/nest-cli",
|
||||||
|
"collection": "@nestjs/schematics",
|
||||||
|
"sourceRoot": "src"
|
||||||
|
}
|
||||||
14601
tests_hugo/nest_app/package-lock.json
generated
Normal file
14601
tests_hugo/nest_app/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
71
tests_hugo/nest_app/package.json
Normal file
71
tests_hugo/nest_app/package.json
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
{
|
||||||
|
"name": "iluvcoffee",
|
||||||
|
"version": "0.0.1",
|
||||||
|
"description": "",
|
||||||
|
"author": "",
|
||||||
|
"private": true,
|
||||||
|
"license": "UNLICENSED",
|
||||||
|
"scripts": {
|
||||||
|
"prebuild": "rimraf dist",
|
||||||
|
"build": "nest build",
|
||||||
|
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
|
||||||
|
"start": "nest start",
|
||||||
|
"start:dev": "nest start --watch",
|
||||||
|
"start:debug": "nest start --debug --watch",
|
||||||
|
"start:prod": "node dist/main",
|
||||||
|
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
|
||||||
|
"test": "jest",
|
||||||
|
"test:watch": "jest --watch",
|
||||||
|
"test:cov": "jest --coverage",
|
||||||
|
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
|
||||||
|
"test:e2e": "jest --config ./test/jest-e2e.json"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@nestjs/common": "^9.0.0",
|
||||||
|
"@nestjs/core": "^9.0.0",
|
||||||
|
"@nestjs/platform-express": "^9.0.0",
|
||||||
|
"reflect-metadata": "^0.1.13",
|
||||||
|
"rimraf": "^3.0.2",
|
||||||
|
"rxjs": "^7.2.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@nestjs/cli": "^9.0.0",
|
||||||
|
"@nestjs/schematics": "^9.0.0",
|
||||||
|
"@nestjs/testing": "^9.0.0",
|
||||||
|
"@types/express": "^4.17.13",
|
||||||
|
"@types/jest": "28.1.8",
|
||||||
|
"@types/node": "^16.0.0",
|
||||||
|
"@types/supertest": "^2.0.11",
|
||||||
|
"@typescript-eslint/eslint-plugin": "^5.0.0",
|
||||||
|
"@typescript-eslint/parser": "^5.0.0",
|
||||||
|
"eslint": "^8.0.1",
|
||||||
|
"eslint-config-prettier": "^8.3.0",
|
||||||
|
"eslint-plugin-prettier": "^4.0.0",
|
||||||
|
"jest": "28.1.3",
|
||||||
|
"prettier": "^2.3.2",
|
||||||
|
"source-map-support": "^0.5.20",
|
||||||
|
"supertest": "^6.1.3",
|
||||||
|
"ts-jest": "28.0.8",
|
||||||
|
"ts-loader": "^9.2.3",
|
||||||
|
"ts-node": "^10.0.0",
|
||||||
|
"tsconfig-paths": "4.1.0",
|
||||||
|
"typescript": "^4.7.4"
|
||||||
|
},
|
||||||
|
"jest": {
|
||||||
|
"moduleFileExtensions": [
|
||||||
|
"js",
|
||||||
|
"json",
|
||||||
|
"ts"
|
||||||
|
],
|
||||||
|
"rootDir": "src",
|
||||||
|
"testRegex": ".*\\.spec\\.ts$",
|
||||||
|
"transform": {
|
||||||
|
"^.+\\.(t|j)s$": "ts-jest"
|
||||||
|
},
|
||||||
|
"collectCoverageFrom": [
|
||||||
|
"**/*.(t|j)s"
|
||||||
|
],
|
||||||
|
"coverageDirectory": "../coverage",
|
||||||
|
"testEnvironment": "node"
|
||||||
|
}
|
||||||
|
}
|
||||||
22
tests_hugo/nest_app/src/app.controller.spec.ts
Normal file
22
tests_hugo/nest_app/src/app.controller.spec.ts
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
import { Test, TestingModule } from '@nestjs/testing';
|
||||||
|
import { AppController } from './app.controller';
|
||||||
|
import { AppService } from './app.service';
|
||||||
|
|
||||||
|
describe('AppController', () => {
|
||||||
|
let appController: AppController;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
const app: TestingModule = await Test.createTestingModule({
|
||||||
|
controllers: [AppController],
|
||||||
|
providers: [AppService],
|
||||||
|
}).compile();
|
||||||
|
|
||||||
|
appController = app.get<AppController>(AppController);
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('root', () => {
|
||||||
|
it('should return "Hello World!"', () => {
|
||||||
|
expect(appController.getHello()).toBe('Hello World!');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
12
tests_hugo/nest_app/src/app.controller.ts
Normal file
12
tests_hugo/nest_app/src/app.controller.ts
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
import { Controller, Get } from '@nestjs/common';
|
||||||
|
import { AppService } from './app.service';
|
||||||
|
|
||||||
|
@Controller()
|
||||||
|
export class AppController {
|
||||||
|
constructor(private readonly appService: AppService) {}
|
||||||
|
|
||||||
|
@Get()
|
||||||
|
getHello(): string {
|
||||||
|
return this.appService.getHello();
|
||||||
|
}
|
||||||
|
}
|
||||||
11
tests_hugo/nest_app/src/app.module.ts
Normal file
11
tests_hugo/nest_app/src/app.module.ts
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import { Module } from '@nestjs/common';
|
||||||
|
import { AppController } from './app.controller';
|
||||||
|
import { AppService } from './app.service';
|
||||||
|
import { CoffeesController } from './coffees/coffees.controller';
|
||||||
|
|
||||||
|
@Module({
|
||||||
|
imports: [],
|
||||||
|
controllers: [AppController, CoffeesController],
|
||||||
|
providers: [AppService],
|
||||||
|
})
|
||||||
|
export class AppModule {}
|
||||||
8
tests_hugo/nest_app/src/app.service.ts
Normal file
8
tests_hugo/nest_app/src/app.service.ts
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
import { Injectable } from '@nestjs/common';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class AppService {
|
||||||
|
getHello(): string {
|
||||||
|
return 'Hello nest!';
|
||||||
|
}
|
||||||
|
}
|
||||||
18
tests_hugo/nest_app/src/coffees/coffees.controller.spec.ts
Normal file
18
tests_hugo/nest_app/src/coffees/coffees.controller.spec.ts
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
import { Test, TestingModule } from '@nestjs/testing';
|
||||||
|
import { CoffeesController } from './coffees.controller';
|
||||||
|
|
||||||
|
describe('CoffeesController', () => {
|
||||||
|
let controller: CoffeesController;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
const module: TestingModule = await Test.createTestingModule({
|
||||||
|
controllers: [CoffeesController],
|
||||||
|
}).compile();
|
||||||
|
|
||||||
|
controller = module.get<CoffeesController>(CoffeesController);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should be defined', () => {
|
||||||
|
expect(controller).toBeDefined();
|
||||||
|
});
|
||||||
|
});
|
||||||
51
tests_hugo/nest_app/src/coffees/coffees.controller.ts
Normal file
51
tests_hugo/nest_app/src/coffees/coffees.controller.ts
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
import {
|
||||||
|
Controller,
|
||||||
|
Get,
|
||||||
|
Param,
|
||||||
|
Post,
|
||||||
|
Body,
|
||||||
|
HttpCode,
|
||||||
|
HttpStatus,
|
||||||
|
Patch,
|
||||||
|
Delete,
|
||||||
|
Query
|
||||||
|
} from '@nestjs/common';
|
||||||
|
|
||||||
|
@Controller('coffees')
|
||||||
|
export class CoffeesController {
|
||||||
|
|
||||||
|
@Get()
|
||||||
|
findAll(@Query() paginationQuery) {
|
||||||
|
const { limit, offset } = paginationQuery;
|
||||||
|
return `this action returns all the coffees.
|
||||||
|
limit: ${limit},
|
||||||
|
offset: ${offset}
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Get('flavors')
|
||||||
|
findFlavors() {
|
||||||
|
return 'this action returns the coffees flavors';
|
||||||
|
}
|
||||||
|
|
||||||
|
@Get(':id')
|
||||||
|
findOne(@Param('id') id: string) {
|
||||||
|
return `this action returns #${id} coffees`;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Post()
|
||||||
|
@HttpCode(HttpStatus.GONE)
|
||||||
|
create(@Body() body) {
|
||||||
|
return body;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Patch(':id')
|
||||||
|
update(@Param('id') id: string, @Body() body) {
|
||||||
|
return `this action updates #${id} coffee`;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Delete(':id')
|
||||||
|
remove(@Param('id') id: string) {
|
||||||
|
return `this action removes #${id} coffee`;
|
||||||
|
}
|
||||||
|
}
|
||||||
8
tests_hugo/nest_app/src/main.ts
Normal file
8
tests_hugo/nest_app/src/main.ts
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
import { NestFactory } from '@nestjs/core';
|
||||||
|
import { AppModule } from './app.module';
|
||||||
|
|
||||||
|
async function bootstrap() {
|
||||||
|
const app = await NestFactory.create(AppModule);
|
||||||
|
await app.listen(3000);
|
||||||
|
}
|
||||||
|
bootstrap();
|
||||||
24
tests_hugo/nest_app/test/app.e2e-spec.ts
Normal file
24
tests_hugo/nest_app/test/app.e2e-spec.ts
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
import { Test, TestingModule } from '@nestjs/testing';
|
||||||
|
import { INestApplication } from '@nestjs/common';
|
||||||
|
import * as request from 'supertest';
|
||||||
|
import { AppModule } from './../src/app.module';
|
||||||
|
|
||||||
|
describe('AppController (e2e)', () => {
|
||||||
|
let app: INestApplication;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
const moduleFixture: TestingModule = await Test.createTestingModule({
|
||||||
|
imports: [AppModule],
|
||||||
|
}).compile();
|
||||||
|
|
||||||
|
app = moduleFixture.createNestApplication();
|
||||||
|
await app.init();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('/ (GET)', () => {
|
||||||
|
return request(app.getHttpServer())
|
||||||
|
.get('/')
|
||||||
|
.expect(200)
|
||||||
|
.expect('Hello World!');
|
||||||
|
});
|
||||||
|
});
|
||||||
9
tests_hugo/nest_app/test/jest-e2e.json
Normal file
9
tests_hugo/nest_app/test/jest-e2e.json
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"moduleFileExtensions": ["js", "json", "ts"],
|
||||||
|
"rootDir": ".",
|
||||||
|
"testEnvironment": "node",
|
||||||
|
"testRegex": ".e2e-spec.ts$",
|
||||||
|
"transform": {
|
||||||
|
"^.+\\.(t|j)s$": "ts-jest"
|
||||||
|
}
|
||||||
|
}
|
||||||
4
tests_hugo/nest_app/tsconfig.build.json
Normal file
4
tests_hugo/nest_app/tsconfig.build.json
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"extends": "./tsconfig.json",
|
||||||
|
"exclude": ["node_modules", "test", "dist", "**/*spec.ts"]
|
||||||
|
}
|
||||||
21
tests_hugo/nest_app/tsconfig.json
Normal file
21
tests_hugo/nest_app/tsconfig.json
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"module": "commonjs",
|
||||||
|
"declaration": true,
|
||||||
|
"removeComments": true,
|
||||||
|
"emitDecoratorMetadata": true,
|
||||||
|
"experimentalDecorators": true,
|
||||||
|
"allowSyntheticDefaultImports": true,
|
||||||
|
"target": "es2017",
|
||||||
|
"sourceMap": true,
|
||||||
|
"outDir": "./dist",
|
||||||
|
"baseUrl": "./",
|
||||||
|
"incremental": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"strictNullChecks": false,
|
||||||
|
"noImplicitAny": false,
|
||||||
|
"strictBindCallApply": false,
|
||||||
|
"forceConsistentCasingInFileNames": false,
|
||||||
|
"noFallthroughCasesInSwitch": false
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user