fix: organize integration tests according to method targets. fix: set timeouts and retries for integration tests
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
import { OnspringClient } from '../src/index';
|
||||
import { OnspringClient } from '../../src/index';
|
||||
import { expect } from 'chai';
|
||||
import { baseURL, apiKey } from './mochaRootHooks';
|
||||
import { baseURL, apiKey } from '../mochaRootHooks';
|
||||
|
||||
describe('getAppById', function () {
|
||||
this.timeout(30000);
|
||||
this.retries(3);
|
||||
|
||||
it('should return an app', async function () {
|
||||
const client = new OnspringClient(baseURL, apiKey);
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
import { OnspringClient, PagingRequest } from '../src/index';
|
||||
import { OnspringClient, PagingRequest } from '../../src/index';
|
||||
import { expect } from 'chai';
|
||||
import { baseURL, apiKey } from './mochaRootHooks';
|
||||
import { baseURL, apiKey } from '../mochaRootHooks';
|
||||
|
||||
describe('getApps', function () {
|
||||
this.timeout(30000);
|
||||
this.retries(3);
|
||||
|
||||
it('should return a paged list of apps', async function () {
|
||||
const client = new OnspringClient(baseURL, apiKey);
|
||||
const response = await client.getApps();
|
||||
@@ -1,8 +1,11 @@
|
||||
import { OnspringClient } from '../src/index';
|
||||
import { OnspringClient } from '../../src/index';
|
||||
import { expect } from 'chai';
|
||||
import { baseURL, apiKey } from './mochaRootHooks';
|
||||
import { baseURL, apiKey } from '../mochaRootHooks';
|
||||
|
||||
describe('getAppsByIds', function () {
|
||||
this.timeout(30000);
|
||||
this.retries(3);
|
||||
|
||||
it('should return a collection of apps', async function () {
|
||||
const client = new OnspringClient(baseURL, apiKey);
|
||||
const appIds = process.env.TEST_APP_IDS;
|
||||
+5
-2
@@ -1,8 +1,11 @@
|
||||
import { OnspringClient } from '../src/index';
|
||||
import { OnspringClient } from '../../src/index';
|
||||
import { expect } from 'chai';
|
||||
import { baseURL, apiKey } from './mochaRootHooks';
|
||||
import { baseURL, apiKey } from '../mochaRootHooks';
|
||||
|
||||
describe('getAppById', function () {
|
||||
this.timeout(30000);
|
||||
this.retries(3);
|
||||
|
||||
it('should return a field', async function () {
|
||||
const client = new OnspringClient(baseURL, apiKey);
|
||||
|
||||
+5
-2
@@ -1,8 +1,11 @@
|
||||
import { OnspringClient, PagingRequest } from '../src/index';
|
||||
import { OnspringClient, PagingRequest } from '../../src/index';
|
||||
import { expect } from 'chai';
|
||||
import { baseURL, apiKey } from './mochaRootHooks';
|
||||
import { baseURL, apiKey } from '../mochaRootHooks';
|
||||
|
||||
describe('getFieldsByAppId', function () {
|
||||
this.timeout(30000);
|
||||
this.retries(3);
|
||||
|
||||
it('should return a paged list of fields', async function () {
|
||||
const client = new OnspringClient(baseURL, apiKey);
|
||||
|
||||
+5
-2
@@ -1,8 +1,11 @@
|
||||
import { OnspringClient } from '../src/index';
|
||||
import { OnspringClient } from '../../src/index';
|
||||
import { expect } from 'chai';
|
||||
import { baseURL, apiKey } from './mochaRootHooks';
|
||||
import { baseURL, apiKey } from '../mochaRootHooks';
|
||||
|
||||
describe('getFieldsByIds', function () {
|
||||
this.timeout(30000);
|
||||
this.retries(3);
|
||||
|
||||
it('should return a collection of fields', async function () {
|
||||
const client = new OnspringClient(baseURL, apiKey);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { type Context } from 'mocha';
|
||||
import { type RootHookObject, type Context } from 'mocha';
|
||||
import { expect } from 'chai';
|
||||
import * as dotenv from 'dotenv';
|
||||
import path from 'path';
|
||||
@@ -8,11 +8,9 @@ dotenv.config({ path: envPath });
|
||||
let baseURL: string | undefined;
|
||||
let apiKey: string | undefined;
|
||||
|
||||
export const mochaHooks = (): Mocha.RootHookObject => {
|
||||
export const mochaHooks = (): RootHookObject => {
|
||||
return {
|
||||
beforeAll(this: Context) {
|
||||
this.timeout('30s');
|
||||
|
||||
baseURL = process.env.API_BASE_URL;
|
||||
apiKey = process.env.SANDBOX_API_KEY;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user