2025-07-08 15:30:13 +00:00
|
|
|
import { expect, tap } from '@git.zone/tstest/tapbundle';
|
2023-11-14 16:15:11 +01:00
|
|
|
import * as opendata from '../ts/index.js'
|
2025-10-31 14:00:59 +00:00
|
|
|
import * as paths from '../ts/paths.js';
|
|
|
|
|
import * as plugins from '../ts/plugins.js';
|
2023-11-14 16:15:11 +01:00
|
|
|
|
2025-01-07 05:06:16 +01:00
|
|
|
import { BusinessRecord } from '../ts/classes.businessrecord.js';
|
|
|
|
|
|
2025-10-31 14:00:59 +00:00
|
|
|
// Test configuration - explicit paths required
|
|
|
|
|
const testNogitDir = plugins.path.join(paths.packageDir, '.nogit');
|
|
|
|
|
const testDownloadDir = plugins.path.join(testNogitDir, 'downloads');
|
|
|
|
|
const testGermanBusinessDataDir = plugins.path.join(testNogitDir, 'germanbusinessdata');
|
|
|
|
|
|
2023-11-14 16:15:11 +01:00
|
|
|
let testOpenDataInstance: opendata.OpenData;
|
|
|
|
|
|
|
|
|
|
tap.test('first test', async () => {
|
2025-10-31 14:00:59 +00:00
|
|
|
testOpenDataInstance = new opendata.OpenData({
|
|
|
|
|
nogitDir: testNogitDir,
|
|
|
|
|
downloadDir: testDownloadDir,
|
|
|
|
|
germanBusinessDataDir: testGermanBusinessDataDir
|
|
|
|
|
});
|
2023-11-14 16:15:11 +01:00
|
|
|
expect(testOpenDataInstance).toBeInstanceOf(opendata.OpenData);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
tap.test('should start the instance', async () => {
|
|
|
|
|
await testOpenDataInstance.start();
|
|
|
|
|
})
|
|
|
|
|
|
2025-04-05 09:02:32 +00:00
|
|
|
tap.test('should build initial data', async () => {
|
2025-01-03 01:36:26 +01:00
|
|
|
await testOpenDataInstance.buildInitialDb();
|
|
|
|
|
});
|
|
|
|
|
|
2025-01-02 01:26:34 +01:00
|
|
|
tap.test('should stop the instance', async () => {
|
|
|
|
|
await testOpenDataInstance.stop();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
2023-11-14 16:15:11 +01:00
|
|
|
tap.start()
|