Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ivov committed Jun 12, 2024
1 parent c0ff93f commit fcda46e
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/cli/test/integration/commands/ldap/reset.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ import { getLdapSynchronizations, saveLdapSynchronization } from '@/Ldap/helpers
import { createLdapConfig } from '../../shared/ldap';
import { LdapService } from '@/Ldap/ldap.service';
import { v4 as uuid } from 'uuid';
import { Telemetry } from '@/telemetry';

mockInstance(Telemetry);

const oclifConfig = new Config({ root: __dirname });

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ import type { SourceControlledFile } from '@/environments/sourceControl/types/so
import * as utils from '../shared/utils/';
import { createUser } from '../shared/db/users';
import type { SuperAgentTest } from '../shared/types';
import { mockInstance } from '@test/mocking';
import { Telemetry } from '@/telemetry';

let authOwnerAgent: SuperAgentTest;
let owner: User;
mockInstance(Telemetry);

const testServer = utils.setupTestServer({
endpointGroups: ['sourceControl', 'license', 'auth'],
Expand Down
4 changes: 4 additions & 0 deletions packages/cli/test/integration/publicApi/executions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import {
createWaitingExecution,
} from '../shared/db/executions';
import type { SuperAgentTest } from '../shared/types';
import { mockInstance } from '@test/mocking';
import { Telemetry } from '@/telemetry';

let owner: User;
let user1: User;
Expand All @@ -26,6 +28,8 @@ let authUser1Agent: SuperAgentTest;
let authUser2Agent: SuperAgentTest;
let workflowRunner: ActiveWorkflowManager;

mockInstance(Telemetry);

const testServer = utils.setupTestServer({ endpointGroups: ['publicApi'] });

beforeAll(async () => {
Expand Down
3 changes: 3 additions & 0 deletions packages/cli/test/integration/publicApi/workflows.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ import { createWorkflow, createWorkflowWithTrigger } from '../shared/db/workflow
import { createTag } from '../shared/db/tags';
import { mockInstance } from '../../shared/mocking';
import type { SuperAgentTest } from '../shared/types';
import { Telemetry } from '@/telemetry';

mockInstance(Telemetry);

let owner: User;
let ownerPersonalProject: Project;
Expand Down
2 changes: 2 additions & 0 deletions packages/cli/test/integration/users.api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ import * as testDb from './shared/testDb';
import { mockInstance } from '../shared/mocking';
import type { SuperAgentTest } from './shared/types';
import { createTeamProject, getPersonalProject, linkUserToProject } from './shared/db/projects';
import { Telemetry } from '@/telemetry';

mockInstance(Telemetry);
mockInstance(ExecutionService);

const testServer = utils.setupTestServer({
Expand Down
3 changes: 3 additions & 0 deletions packages/cli/test/integration/webhooks.api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ import * as testDb from './shared/testDb';
import { createUser } from './shared/db/users';
import { createWorkflow } from './shared/db/workflows';
import type { SuperAgentTest } from './shared/types';
import { Telemetry } from '@/telemetry';

mockInstance(Telemetry);

describe('Webhook API', () => {
mockInstance(ExternalHooks);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ import * as testDb from '../shared/testDb';
import { createUser } from '../shared/db/users';
import { createWorkflowWithTrigger } from '../shared/db/workflows';
import { createTeamProject } from '../shared/db/projects';
import { mockInstance } from '@test/mocking';
import { Telemetry } from '@/telemetry';

mockInstance(Telemetry);

let member: User;
let anotherMember: User;
Expand Down
4 changes: 4 additions & 0 deletions packages/cli/test/unit/WorkflowRunner.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@ import { setupTestServer } from '../integration/shared/utils';
import { createUser } from '../integration/shared/db/users';
import { createWorkflow } from '../integration/shared/db/workflows';
import { createExecution } from '../integration/shared/db/executions';
import { mockInstance } from '@test/mocking';
import { Telemetry } from '@/telemetry';

let owner: User;
let runner: WorkflowRunner;
let hookFunctions: IWorkflowExecuteHooks;
setupTestServer({ endpointGroups: [] });

mockInstance(Telemetry);

class Watchers {
workflowExecuteAfter = jest.fn();
}
Expand Down

0 comments on commit fcda46e

Please sign in to comment.