2023-11-14 16:15:11 +01:00
|
|
|
import { expect, expectAsync, tap } from '@push.rocks/tapbundle';
|
|
|
|
import * as opendata from '../ts/index.js'
|
|
|
|
|
|
|
|
let testOpenDataInstance: opendata.OpenData;
|
|
|
|
|
|
|
|
tap.test('first test', async () => {
|
|
|
|
testOpenDataInstance = new opendata.OpenData();
|
|
|
|
expect(testOpenDataInstance).toBeInstanceOf(opendata.OpenData);
|
|
|
|
});
|
|
|
|
|
|
|
|
tap.test('should start the instance', async () => {
|
|
|
|
await testOpenDataInstance.start();
|
|
|
|
})
|
|
|
|
|
2025-01-03 01:36:26 +01:00
|
|
|
tap.skip.test('should build initial data', async () => {
|
|
|
|
await testOpenDataInstance.buildInitialDb();
|
|
|
|
});
|
|
|
|
|
|
|
|
const resultsSearch = tap.test('should get the data for a company', async () => {
|
|
|
|
const result = await testOpenDataInstance.handelsregister.searchCompany('Volkswagen');
|
|
|
|
console.log(result);
|
|
|
|
return result;
|
|
|
|
});
|
|
|
|
|
|
|
|
tap.test('should get the data for a specific company', async () => {
|
|
|
|
const testCompany = (await resultsSearch.testResultPromise)[21]['germanParsedRegistration'];
|
|
|
|
console.log(`trying to find specific company with:`);
|
|
|
|
console.log(testCompany);
|
|
|
|
const result = await testOpenDataInstance.handelsregister.getSpecificCompany(testCompany);
|
2025-01-02 01:26:34 +01:00
|
|
|
console.log(result);
|
|
|
|
});
|
|
|
|
|
|
|
|
tap.test('should stop the instance', async () => {
|
|
|
|
await testOpenDataInstance.stop();
|
|
|
|
});
|
|
|
|
|
|
|
|
|
2023-11-14 16:15:11 +01:00
|
|
|
tap.start()
|