Skip to content

Commit

Permalink
test(shouldRun): add test to verify that "mergeMetadata" does not add…
Browse files Browse the repository at this point in the history
… symbols
  • Loading branch information
hasezoey committed Apr 27, 2023
1 parent 5fec7e0 commit 3e517b5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test/tests/shouldRun.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as mongoose from 'mongoose';
import { mapValueToSeverity } from '../../src/globalOptions';
import { DecoratorKeys, PropType, Severity } from '../../src/internal/constants';
import { AlreadyMerged, DecoratorKeys, PropType, Severity } from '../../src/internal/constants';
import { globalOptions } from '../../src/internal/data';
import {
assertion,
Expand Down Expand Up @@ -1086,3 +1086,12 @@ it(`should Validate Map`, async () => {
);
}
});

it('should not merge together symbols', () => {
class Test {}

const res = mergeMetadata(DecoratorKeys.ModelOptions, { [AlreadyMerged]: true, anotherValue: true }, Test);

expect(res).toStrictEqual({ anotherValue: true });
expect(res[AlreadyMerged]).toBeUndefined();
});

0 comments on commit 3e517b5

Please sign in to comment.