fix: update integration tests to use a root beforeAll hook that loads the environment variables and assigns values to the api key and base url to be used when constructing the onspring client used in the integration tests

This commit is contained in:
StevanFreeborn
2023-02-14 22:47:16 -06:00
parent 4fe1d7c4a7
commit 8e1d9051ae
7 changed files with 41 additions and 70 deletions
+1 -13
View File
@@ -1,20 +1,8 @@
import { OnspringClient } from '../src/index';
import { expect } from 'chai';
import * as dotenv from 'dotenv';
import path from 'path';
const envPath = path.resolve(__dirname, '.env');
dotenv.config({ path: envPath });
import { baseURL, apiKey } from './mochaRootHooks';
describe('getAppsByIds', function () {
this.timeout('30s');
let baseURL;
let apiKey;
before(function () {
baseURL = process.env.API_BASE_URL;
apiKey = process.env.SANDBOX_API_KEY;
});
it('should return a collection of apps', async function () {
const client = new OnspringClient(baseURL, apiKey);
const appIds = process.env.TEST_APP_IDS;