feat: migrate backend to cosmiconfig

This commit is contained in:
2023-04-25 15:54:06 +02:00
parent d8c79256c9
commit 0a76427ba8
70 changed files with 1786 additions and 1635 deletions

View File

@@ -33,9 +33,9 @@ import {createFileSync} from 'fs-extra';
// eslint-disable-next-line unicorn/prevent-abbreviations
import {e2eRun, getItemsFromSamples, ApiError, HttpClient, RequestOptions, Response} from '../src/index.js';
import {RecursivePartial} from './client.spec.js';
import {expect} from "chai";
import path from "path";
import {fileURLToPath} from "url";
import {expect} from 'chai';
import path from 'path';
import {fileURLToPath} from 'url';
chai.should();
chai.use(chaiSpies);
@@ -184,14 +184,18 @@ describe('e2e Connector', function () {
if (!existsSync(emptyDirectoryPath)) {
mkdirSync(emptyDirectoryPath);
}
await e2eRun(httpClient, {to: 'http://localhost', samplesLocation: emptyDirectoryPath}).should.be.rejectedWith(
'Could not index samples. None were retrieved from the file system.',
);
await e2eRun(httpClient, {
to: 'http://localhost',
samplesLocation: emptyDirectoryPath,
}).should.be.rejectedWith('Could not index samples. None were retrieved from the file system.');
rmdirSync(emptyDirectoryPath);
});
it('should fail to index directory without json data', async function () {
const somewhatFilledDirectoryPath = path.join(path.dirname(fileURLToPath(import.meta.url)), 'somewhatFilledDir');
const somewhatFilledDirectoryPath = path.join(
path.dirname(fileURLToPath(import.meta.url)),
'somewhatFilledDir',
);
if (!existsSync(somewhatFilledDirectoryPath)) {
mkdirSync(somewhatFilledDirectoryPath);
}