Skip to content

Commit

Permalink
feat(decorators): implements some decorators and adds tests
Browse files Browse the repository at this point in the history
* feat(decorators): implements some decorators and adds tests

* chore: updates yarn.lock
  • Loading branch information
pablolazaro committed Oct 16, 2019
1 parent b87a077 commit 930c2ec
Show file tree
Hide file tree
Showing 23 changed files with 23,182 additions and 111 deletions.
16 changes: 4 additions & 12 deletions examples/spotify/controllers/artists.custom-controller.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
import { Body, Controller, HttpCode, Post } from '@nestjs/common';
import {
DatabaseRegistry,
DocumentService,
DocumentRepository
} from '@mockly/server';
import { DocumentService, InjectService } from '@mockly/core';

@Controller('artist')
export class ArtistsCustomController {
private readonly _service: DocumentService<any>;

constructor(readonly registry: DatabaseRegistry) {
this._service = new DocumentService<any>(
new DocumentRepository<any>(registry.get('artists'))
);
}
constructor(
@InjectService('artists') private readonly _service: DocumentService<any>
) {}

@Post()
@HttpCode(201)
Expand Down
6 changes: 5 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,9 @@ module.exports = {
resolver: '@nrwl/jest/plugins/resolver',
moduleFileExtensions: ['ts', 'js', 'html'],
collectCoverage: true,
coverageReporters: ['html', 'lcov', 'json']
coverageReporters: ['html', 'lcov', 'json'],
watchPlugins: [
'jest-watch-typeahead/filename',
'jest-watch-typeahead/testname'
]
};
Loading

0 comments on commit 930c2ec

Please sign in to comment.