Skip to content

Commit

Permalink
refactor(core): add buildDefaultMaybeClassElementMetadata
Browse files Browse the repository at this point in the history
  • Loading branch information
notaphplover committed Nov 16, 2024
1 parent 7eb68e2 commit 1434fb0
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { beforeAll, describe, expect, it } from '@jest/globals';

import { MaybeClassElementMetadataKind } from '../models/MaybeClassElementMetadataKind';
import { MaybeManagedClassElementMetadata } from '../models/MaybeManagedClassElementMetadata';
import { buildDefaultMaybeClassElementMetadata } from './buildDefaultMaybeClassElementMetadata';

describe(buildDefaultMaybeClassElementMetadata.name, () => {
describe('when called', () => {
let result: unknown;

beforeAll(() => {
result = buildDefaultMaybeClassElementMetadata();
});

it('should return MaybeManagedClassElementMetadata', () => {
const expected: MaybeManagedClassElementMetadata = {
kind: MaybeClassElementMetadataKind.unknown,
name: undefined,
optional: false,
tags: new Map(),
targetName: undefined,
};

expect(result).toStrictEqual(expected);
});
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { MaybeClassElementMetadataKind } from '../models/MaybeClassElementMetadataKind';
import { MaybeManagedClassElementMetadata } from '../models/MaybeManagedClassElementMetadata';

export function buildDefaultMaybeClassElementMetadata(): MaybeManagedClassElementMetadata {
return {
kind: MaybeClassElementMetadataKind.unknown,
name: undefined,
optional: false,
tags: new Map(),
targetName: undefined,
};
}

0 comments on commit 1434fb0

Please sign in to comment.