-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
176 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
import { createTestListObject } from './data'; | ||
|
||
describe('Data utilities', () => { | ||
it('Should return correct test list from test result object', async () => { | ||
const testRunResult = { | ||
results: { | ||
numFailedTestSuites: 0, | ||
numFailedTests: 0, | ||
numPassedTestSuites: 1, | ||
numPassedTests: 4, | ||
numPendingTestSuites: 0, | ||
numPendingTests: 0, | ||
numRuntimeErrorTestSuites: 0, | ||
numTodoTests: 0, | ||
numTotalTestSuites: 1, | ||
numTotalTests: 4, | ||
openHandles: [], | ||
snapshot: { | ||
added: 0, | ||
didUpdate: false, | ||
failure: false, | ||
filesAdded: 0, | ||
filesRemoved: 0, | ||
filesRemovedList: [], | ||
filesUnmatched: 0, | ||
filesUpdated: 0, | ||
matched: 0, | ||
total: 0, | ||
unchecked: 0, | ||
uncheckedKeysByFile: [], | ||
unmatched: 0, | ||
updated: 0, | ||
}, | ||
startTime: 1725776846607, | ||
success: true, | ||
testResults: [ | ||
{ | ||
leaks: false, | ||
numFailingTests: 0, | ||
numPassingTests: 4, | ||
numPendingTests: 0, | ||
numTodoTests: 0, | ||
openHandles: [], | ||
perfStats: { | ||
end: 1725776847159, | ||
runtime: 524, | ||
slow: false, | ||
start: 1725776846635, | ||
}, | ||
skipped: false, | ||
snapshot: { | ||
added: 0, | ||
fileDeleted: false, | ||
matched: 0, | ||
unchecked: 0, | ||
uncheckedKeys: [], | ||
unmatched: 0, | ||
updated: 0, | ||
}, | ||
testFilePath: '/app/src/suites/1.0.0-ballot/Patient/patients.spec.ts', | ||
testResults: [ | ||
{ | ||
ancestorTitles: ['Patients test'], | ||
duration: 3, | ||
failureDetails: [], | ||
failureMessages: [], | ||
fullName: 'Patients test Should only have available interactions', | ||
invocations: 1, | ||
location: null, | ||
numPassingAsserts: 1, | ||
retryReasons: [], | ||
status: 'passed', | ||
title: 'Should only have available interactions', | ||
}, | ||
{ | ||
ancestorTitles: ['Patients test'], | ||
duration: 1, | ||
failureDetails: [], | ||
failureMessages: [], | ||
fullName: 'Patients test Should only have available search params', | ||
invocations: 1, | ||
location: null, | ||
numPassingAsserts: 1, | ||
retryReasons: [], | ||
status: 'passed', | ||
title: 'Should only have available search params', | ||
}, | ||
{ | ||
ancestorTitles: ['Patients test'], | ||
duration: 1, | ||
failureDetails: [], | ||
failureMessages: [], | ||
fullName: 'Patients test Should only have available combo search params', | ||
invocations: 1, | ||
location: null, | ||
numPassingAsserts: 1, | ||
retryReasons: [], | ||
status: 'passed', | ||
title: 'Should only have available combo search params', | ||
}, | ||
{ | ||
ancestorTitles: ['Patients test'], | ||
duration: 0, | ||
failureDetails: [], | ||
failureMessages: [], | ||
fullName: 'Patients test Should only have valid resources in CREATE action', | ||
invocations: 1, | ||
location: null, | ||
numPassingAsserts: 1, | ||
retryReasons: [], | ||
status: 'passed', | ||
title: 'Should only have valid resources in CREATE action', | ||
}, | ||
], | ||
failureMessage: null, | ||
}, | ||
], | ||
wasInterrupted: false, | ||
}, | ||
}; | ||
|
||
expect(createTestListObject(testRunResult)).toEqual([ | ||
{ | ||
suiteId: '1.0.0-ballot', | ||
groups: [ | ||
{ | ||
groupName: 'Patients test', | ||
tests: [ | ||
'Patients test Should only have available interactions', | ||
'Patients test Should only have available search params', | ||
'Patients test Should only have available combo search params', | ||
'Patients test Should only have valid resources in CREATE action', | ||
], | ||
}, | ||
], | ||
}, | ||
]); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters