Skip to content

Commit f187e0f

Browse files
committed
test(utils): add unit test to cover declaration of non existing metadata
1 parent 04e8376 commit f187e0f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/utils/metadata.manager.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,4 +344,14 @@ describe('Metadata Manager', () => {
344344
'export class FooModule {}\n'
345345
);
346346
});
347+
it('should return undefined if there is no metadata to update', () => {
348+
const metadata = 'imports';
349+
const symbol = 'FooModule';
350+
const manager = new MetadataManager(
351+
'import { Module } from \'@nestjs/common\';\n' +
352+
'\n' +
353+
'export class FooModule {}\n'
354+
);
355+
expect(manager.insert(metadata, symbol)).toEqual(undefined);
356+
});
347357
});

0 commit comments

Comments
 (0)