Files
gitops/test/test.basic_test.ts

34 lines
1.3 KiB
TypeScript

import { assertEquals, assertExists } from 'https://deno.land/std@0.208.0/assert/mod.ts';
import { BaseProvider, GiteaProvider, GitLabProvider } from '../ts/providers/index.ts';
import { ConnectionManager } from '../ts/classes/connectionmanager.ts';
import { GitopsApp } from '../ts/classes/gitopsapp.ts';
import { StorageManager } from '../ts/storage/index.ts';
Deno.test('GiteaProvider instantiates correctly', () => {
const provider = new GiteaProvider('test-id', 'https://gitea.example.com', 'test-token');
assertExists(provider);
assertEquals(provider.connectionId, 'test-id');
assertEquals(provider.baseUrl, 'https://gitea.example.com');
});
Deno.test('GitLabProvider instantiates correctly', () => {
const provider = new GitLabProvider('test-id', 'https://gitlab.example.com', 'test-token');
assertExists(provider);
assertEquals(provider.connectionId, 'test-id');
assertEquals(provider.baseUrl, 'https://gitlab.example.com');
});
Deno.test('ConnectionManager instantiates correctly', () => {
const storage = new StorageManager({ backend: 'memory' });
const manager = new ConnectionManager(storage);
assertExists(manager);
});
Deno.test('GitopsApp instantiates correctly', () => {
const app = new GitopsApp();
assertExists(app);
assertExists(app.storageManager);
assertExists(app.connectionManager);
assertExists(app.opsServer);
});