Skip to content

Commit

Permalink
bugfix(core) revert stringify instead of hash
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilmysliwiec committed Sep 13, 2018
1 parent 14f737f commit ce498e8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/core/injector/module-token-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class ModuleTokenFactory {
public getDynamicMetadataToken(
dynamicModuleMetadata: Partial<DynamicModule> | undefined,
): string {
return dynamicModuleMetadata ? hash(dynamicModuleMetadata) : '';
return dynamicModuleMetadata ? JSON.stringify(dynamicModuleMetadata) : '';
}

public getModuleName(metatype: Type<any>): string {
Expand Down
4 changes: 2 additions & 2 deletions packages/core/test/injector/module-token-factory.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ describe('ModuleTokenFactory', () => {
expect(token).to.be.deep.eq(
hash({
module: Module.name,
dynamic: hash({
dynamic: JSON.stringify({
components: [{}],
}),
scope: [Module.name],
Expand All @@ -65,7 +65,7 @@ describe('ModuleTokenFactory', () => {
it('should return hash', () => {
const metadata = { components: ['', {}] };
expect(factory.getDynamicMetadataToken(metadata as any)).to.be.eql(
hash(metadata),
JSON.stringify(metadata),
);
});
});
Expand Down
1 change: 1 addition & 0 deletions sample/22-graphql-prisma/src/prisma/prisma.module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Module } from '@nestjs/common';
import { PrismaService } from './prisma.service';

@Module({
providers: [PrismaService],
exports: [PrismaService],
Expand Down

0 comments on commit ce498e8

Please sign in to comment.