mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-21 17:12:43 +00:00
feat: migrate backend to cosmiconfig
This commit is contained in:
@@ -35,10 +35,17 @@ import chaiSpies from 'chai-spies';
|
||||
import clone = require('rfdc');
|
||||
import moment from 'moment';
|
||||
import traverse from 'traverse';
|
||||
import {ConnectorClient, EmptyBulkError, NamespaceNotDefinedError, HttpClient, HttpClientRequest, HttpClientResponse} from '../src/index.js';
|
||||
import path from "path";
|
||||
import {fileURLToPath} from "url";
|
||||
import {readdir, readFile} from "fs/promises";
|
||||
import {
|
||||
ConnectorClient,
|
||||
EmptyBulkError,
|
||||
NamespaceNotDefinedError,
|
||||
HttpClient,
|
||||
HttpClientRequest,
|
||||
HttpClientResponse,
|
||||
} from '../src/index.js';
|
||||
import path from 'path';
|
||||
import {fileURLToPath} from 'url';
|
||||
import {readdir, readFile} from 'fs/promises';
|
||||
|
||||
chai.should();
|
||||
chai.use(chaiSpies);
|
||||
@@ -333,7 +340,7 @@ describe('ConnectorClient', function () {
|
||||
expect(ConnectorClient.makeUUID('foo', 'f-u')).not.to.be.equal(uuid);
|
||||
});
|
||||
|
||||
it('should fail making a uuid', async function (){
|
||||
it('should fail making a uuid', async function () {
|
||||
expect(() => {
|
||||
ConnectorClient.makeUUID('foo', 'b-u');
|
||||
}).to.throw(NamespaceNotDefinedError);
|
||||
@@ -353,12 +360,14 @@ describe('ConnectorClient', function () {
|
||||
|
||||
const testFiles = await readdir(pathToTestFiles);
|
||||
|
||||
const testInstances = await Promise.all(testFiles.map(async testFile => {
|
||||
const buffer = await readFile(path.join(pathToTestFiles, testFile));
|
||||
const content = JSON.parse(buffer.toString());
|
||||
const testInstances = await Promise.all(
|
||||
testFiles.map(async testFile => {
|
||||
const buffer = await readFile(path.join(pathToTestFiles, testFile));
|
||||
const content = JSON.parse(buffer.toString());
|
||||
|
||||
return content.instance;
|
||||
}));
|
||||
return content.instance;
|
||||
}),
|
||||
);
|
||||
|
||||
for (const testInstance of testInstances) {
|
||||
const checkInstance = clone()(testInstance);
|
||||
|
||||
Reference in New Issue
Block a user