@mdfriday/foundry
Version:
The core engine of MDFriday. Convert Markdown and shortcodes into fully themed static sites – Hugo-style, powered by TypeScript.
43 lines • 1.75 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const service_1 = require("../entity/service");
// Mock dependencies
jest.mock('../vo/filevitural');
describe('Service Entity', () => {
let service;
beforeEach(() => {
service = new service_1.Service();
});
afterEach(() => {
jest.clearAllMocks();
});
describe('newFileMetaInfo', () => {
it('should create FileMetaInfo with filename', () => {
const filename = 'test.txt';
const mockFileMetaInfo = {};
const { newFileInfoWithName } = require('../vo/filevitural');
newFileInfoWithName.mockReturnValue(mockFileMetaInfo);
const result = service.newFileMetaInfo(filename);
expect(newFileInfoWithName).toHaveBeenCalledWith(filename);
expect(result).toBe(mockFileMetaInfo);
});
});
describe('newFileMetaInfoWithContent', () => {
it('should create FileMetaInfo with content', () => {
const content = 'test content';
const mockFileMetaInfo = {};
const { newFileInfoWithContent } = require('../vo/filevitural');
newFileInfoWithContent.mockReturnValue(mockFileMetaInfo);
const result = service.newFileMetaInfoWithContent(content);
expect(newFileInfoWithContent).toHaveBeenCalledWith(content);
expect(result).toBe(mockFileMetaInfo);
});
});
describe('newService factory function', () => {
it('should create new Service instance', () => {
const result = (0, service_1.newService)();
expect(result).toBeInstanceOf(service_1.Service);
});
});
});
//# sourceMappingURL=entity-service.test.js.map