Skip to content

Commit 91c234c

Browse files
adam-in-ictmscottford
authored andcommitted
Updating tests that previously expected throws.
1 parent 5362424 commit 91c234c

2 files changed

Lines changed: 12 additions & 40 deletions

File tree

packages/integration-sdk-cli/src/__tests__/cli-run.test.ts

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ test('disables graph object schema validation', async () => {
8080
expect(process.env.ENABLE_GRAPH_OBJECT_SCHEMA_VALIDATION).toBeUndefined();
8181
});
8282

83-
test('step should fail if enableSchemaValidation = true', async () => {
83+
test('step should warn if enableSchemaValidation = true', async () => {
84+
const consoleSpy = jest.spyOn(console, 'warn');
8485
loadProjectStructure('instanceWithNonValidatingSteps');
8586
const job = generateSynchronizationJob();
8687

@@ -101,26 +102,11 @@ test('step should fail if enableSchemaValidation = true', async () => {
101102
expect(log.displaySynchronizationResults).toHaveBeenCalledTimes(1);
102103

103104
expect(log.displayExecutionResults).toHaveBeenCalledTimes(1);
104-
expect(log.displayExecutionResults).toHaveBeenCalledWith({
105-
integrationStepResults: [
106-
{
107-
id: 'fetch-users',
108-
name: 'Fetch Users',
109-
declaredTypes: ['my_user'],
110-
partialTypes: [],
111-
encounteredTypes: [],
112-
status: StepResultStatus.FAILURE,
113-
},
114-
],
115-
metadata: {
116-
partialDatasets: {
117-
types: ['my_user'],
118-
},
119-
},
120-
});
105+
expect(consoleSpy).toHaveBeenCalled();
121106
});
122107

123-
test('step should pass if enableSchemaValidation = false', async () => {
108+
test('step should pass and not warn if enableSchemaValidation = false', async () => {
109+
const consoleSpy = jest.spyOn(console, 'warn');
124110
loadProjectStructure('instanceWithNonValidatingSteps');
125111
const job = generateSynchronizationJob();
126112

@@ -159,6 +145,7 @@ test('step should pass if enableSchemaValidation = false', async () => {
159145
},
160146
},
161147
});
148+
expect(consoleSpy).not.toHaveBeenCalled();
162149
});
163150

164151
test('executes integration and performs upload', async () => {

packages/integration-sdk-cli/src/__tests__/cli.test.ts

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -199,30 +199,14 @@ describe('collect', () => {
199199
delete process.env.ENABLE_GRAPH_OBJECT_SCHEMA_VALIDATION;
200200
});
201201

202-
test('step should fail if enableSchemaValidation = true', async () => {
202+
test('step should warn if enableSchemaValidation = true', async () => {
203+
const consoleSpy = jest.spyOn(console, 'warn');
203204
await createCli().parseAsync(['node', 'j1-integration', 'collect']);
204-
205-
expect(log.displayExecutionResults).toHaveBeenCalledTimes(1);
206-
expect(log.displayExecutionResults).toHaveBeenCalledWith({
207-
integrationStepResults: [
208-
{
209-
id: 'fetch-users',
210-
name: 'Fetch Users',
211-
declaredTypes: ['my_user'],
212-
partialTypes: [],
213-
encounteredTypes: [],
214-
status: StepResultStatus.FAILURE,
215-
},
216-
],
217-
metadata: {
218-
partialDatasets: {
219-
types: ['my_user'],
220-
},
221-
},
222-
});
205+
expect(consoleSpy).toHaveBeenCalled();
223206
});
224207

225-
test('step should pass if enableSchemaValidation = false', async () => {
208+
test('step should pass and not warn if enableSchemaValidation = false', async () => {
209+
const consoleSpy = jest.spyOn(console, 'warn');
226210
await createCli().parseAsync([
227211
'node',
228212
'j1-integration',
@@ -248,6 +232,7 @@ describe('collect', () => {
248232
},
249233
},
250234
});
235+
expect(consoleSpy).not.toHaveBeenCalled();
251236
});
252237
});
253238

0 commit comments

Comments
 (0)