Skip to content

Commit

Permalink
test: add unit test on process test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
ldhyen99 committed Sep 23, 2024
1 parent 8503451 commit 187644c
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions packages/untp-test-suite/__tests__/core/processTestSuite.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,13 +332,15 @@ describe('processTestSuiteForConfigPath with remote schema URL', () => {
},
]);

jest.spyOn(testRunner, 'processCheckDataBySchema').mockReturnValueOnce({
type: '',
version: '',
dataPath: 'data/productPassport.json',
url: 'https://example.com/product-passport/schema.json',
errors: [],
});
jest.spyOn(testRunner, 'processCheckDataBySchema').mockReturnValueOnce(
Promise.resolve({
type: '',
version: '',
dataPath: 'data/productPassport.json',
url: 'https://example.com/product-passport/schema.json',
errors: [],
}),
);

jest.spyOn(templateUtils, 'constructCredentialTestResults').mockResolvedValueOnce([
{
Expand Down Expand Up @@ -383,13 +385,15 @@ describe('processTestSuiteForConfigPath with remote schema URL', () => {
},
]);

jest.spyOn(testRunner, 'processCheckDataBySchema').mockReturnValueOnce({
type: 'productPassport',
version: 'v0.0.1',
dataPath: 'data/productPassport.json',
url: 'https://example.com/product-passport/schema.json',
errors: [],
});
jest.spyOn(testRunner, 'processCheckDataBySchema').mockReturnValueOnce(
Promise.resolve({
type: 'productPassport',
version: 'v0.0.1',
dataPath: 'data/productPassport.json',
url: 'https://example.com/product-passport/schema.json',
errors: [],
}),
);

jest.spyOn(templateUtils, 'constructCredentialTestResults').mockResolvedValueOnce([
{
Expand Down

0 comments on commit 187644c

Please sign in to comment.