Files
nest/packages/common/test/utils/merge-with-values.util.spec.ts
2018-10-05 12:31:53 +02:00

19 lines
496 B
TypeScript

import { expect } from 'chai';
import { MergeWithValues } from '../../utils/merge-with-values.util';
describe('MergeWithValues', () => {
let type;
const data = { test: [1, 2, 3] };
class Test {}
beforeEach(() => {
type = MergeWithValues(data)(Test);
});
it('should enrich prototype with given values', () => {
expect(type.prototype).to.contain(data);
});
it('should set name of metatype', () => {
expect(type.name).to.eq(Test.name + JSON.stringify(data));
});
});