This commit is contained in:
2026-01-23 22:15:51 +00:00
commit 74d24cf8b9
44 changed files with 15483 additions and 0 deletions

43
test/test.tsview.ts Normal file
View File

@@ -0,0 +1,43 @@
import { tap, expect } from '@git.zone/tstest/tapbundle';
import * as tsview from '../ts/index.js';
tap.test('should export TsView class', async () => {
expect(tsview.TsView).toBeDefined();
});
tap.test('should create TsView instance', async () => {
const viewer = new tsview.TsView();
expect(viewer).toBeInstanceOf(tsview.TsView);
expect(viewer.config).toBeDefined();
});
tap.test('should have config methods', async () => {
const viewer = new tsview.TsView();
// Set S3 config
viewer.setS3Config({
endpoint: 'localhost',
port: 9000,
accessKey: 'test',
accessSecret: 'test',
useSsl: false,
});
expect(viewer.config.hasS3()).toBeTrue();
expect(viewer.config.hasMongo()).toBeFalse();
// Set MongoDB config
viewer.setMongoConfig({
mongoDbUrl: 'mongodb://localhost:27017',
mongoDbName: 'test',
});
expect(viewer.config.hasMongo()).toBeTrue();
});
tap.test('should have runCli export', async () => {
expect(tsview.runCli).toBeDefined();
expect(typeof tsview.runCli).toBe('function');
});
export default tap.start();