Skip to content

Commit

Permalink
test: fixing lint and fixing old test
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] authored and wovalle committed Jun 28, 2019
1 parent e36f2df commit e57d0d8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/BaseFirestoreRepository.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,11 @@ describe('BaseRepository', () => {
describe('findById', () => {
it('must find by id', async () => {
const pt = await bandRepository.findById('porcupine-tree');
expect(pt).instanceOf(Band);
expect(pt.id).to.equal('porcupine-tree');
expect(pt.name).to.equal('Porcupine Tree');
});
/*
<Sarcasm>Because of the useful generic type reflection of typescript</Sarcasm>
this test is not stable. Might be a good idea to revisit later.
*/
it('must return T');

it('must have proper getters', async () => {
const pt = await bandRepository.findById('porcupine-tree');
expect(pt.getLastShowYear()).to.eql(2010);
Expand Down
1 change: 1 addition & 0 deletions src/BaseFirestoreRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ export default class BaseFirestoreRepository<T extends IEntity>
return null;
}

// tslint:disable-next-line:no-unnecessary-type-assertion
const entity = plainToClass(
this.colMetadata.entity as any,
this.transformFirestoreTypes(doc.data() as T)
Expand Down

0 comments on commit e57d0d8

Please sign in to comment.