Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(mojaloop/#3909): update func test harness and add fx sdk tests #489

Merged
merged 12 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2906,7 +2906,7 @@ components:
- description: Identifies the quote message.
- example: b51ec534-ee48-4575-b6a9-ead2955b8069
payee:
allOf:
allOf:
- $ref: "#/components/schemas/Party"
- description: Information about the Payee in the proposed financial transaction.
transferAmount:
Expand Down Expand Up @@ -3796,4 +3796,4 @@ components:
required: true
schema:
type: string
description: A sub-identifier of the party identifier, or a sub-type of the party identifier's type. For example, `PASSPORT`, `DRIVING_LICENSE`.
description: A sub-identifier of the party identifier, or a sub-type of the party identifier's type. For example, `PASSPORT`, `DRIVING_LICENSE`.
3 changes: 2 additions & 1 deletion modules/api-svc/src/lib/dto.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*eslint quote-props: ["error", "as-needed"]*/
const randomUUID = require('@mojaloop/central-services-shared').Util.id();
const config = require('../config');
const randomUUID = require('@mojaloop/central-services-shared').Util.id(config.idGenerator);
const { Directions, SDKStateEnum} = require('./model/common');

const quoteRequestStateDto = (request) => ({
Expand Down
8 changes: 8 additions & 0 deletions modules/api-svc/test/unit/FSPIOPEventHandler.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
'use strict';

process.env.PEER_ENDPOINT = '172.17.0.3:4000';
process.env.BACKEND_ENDPOINT = '172.17.0.5:4000';
process.env.CACHE_URL = 'redis://172.17.0.2:6379';
process.env.MGMT_API_WS_URL = '0.0.0.0';
process.env.SUPPORTED_CURRENCIES='USD';

const { FSPIOPEventHandler } = require('../../src/FSPIOPEventHandler');
const bulkQuoteRequest = require('../unit/lib/model/data/bulkQuoteRequest.json');
const { Logger } = require('@mojaloop/sdk-standard-components');
Expand Down
6 changes: 6 additions & 0 deletions modules/api-svc/test/unit/InboundServer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@

'use strict';

process.env.PEER_ENDPOINT = '172.17.0.3:4000';
process.env.BACKEND_ENDPOINT = '172.17.0.5:4000';
process.env.CACHE_URL = 'redis://172.17.0.2:6379';
process.env.MGMT_API_WS_URL = '0.0.0.0';
process.env.SUPPORTED_CURRENCIES='USD';

const supertest = require('supertest');

const defaultConfig = require('./data/defaultConfig');
Expand Down
6 changes: 6 additions & 0 deletions modules/api-svc/test/unit/TestServer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@

'use strict';

process.env.PEER_ENDPOINT = '172.17.0.3:4000';
process.env.BACKEND_ENDPOINT = '172.17.0.5:4000';
process.env.CACHE_URL = 'redis://172.17.0.2:6379';
process.env.MGMT_API_WS_URL = '0.0.0.0';
process.env.SUPPORTED_CURRENCIES='USD';

const supertest = require('supertest');

const defaultConfig = require('./data/defaultConfig');
Expand Down
6 changes: 6 additions & 0 deletions modules/api-svc/test/unit/api/accounts/accounts.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@

'use strict';

process.env.PEER_ENDPOINT = '172.17.0.3:4000';
process.env.BACKEND_ENDPOINT = '172.17.0.5:4000';
process.env.CACHE_URL = 'redis://172.17.0.2:6379';
process.env.MGMT_API_WS_URL = '0.0.0.0';
process.env.SUPPORTED_CURRENCIES='USD';

jest.unmock('@mojaloop/sdk-standard-components');
jest.mock('redis');

Expand Down
6 changes: 6 additions & 0 deletions modules/api-svc/test/unit/api/proxy/proxy.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@

'use strict';

process.env.PEER_ENDPOINT = '172.17.0.3:4000';
process.env.BACKEND_ENDPOINT = '172.17.0.5:4000';
process.env.CACHE_URL = 'redis://172.17.0.2:6379';
process.env.MGMT_API_WS_URL = '0.0.0.0';
process.env.SUPPORTED_CURRENCIES='USD';

jest.unmock('@mojaloop/sdk-standard-components');
jest.mock('redis');

Expand Down
6 changes: 6 additions & 0 deletions modules/api-svc/test/unit/api/transfers/transfers.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@

'use strict';

process.env.PEER_ENDPOINT = '172.17.0.3:4000';
process.env.BACKEND_ENDPOINT = '172.17.0.5:4000';
process.env.CACHE_URL = 'redis://172.17.0.2:6379';
process.env.MGMT_API_WS_URL = '0.0.0.0';
process.env.SUPPORTED_CURRENCIES='USD';

jest.unmock('@mojaloop/sdk-standard-components');
jest.mock('redis');

Expand Down
6 changes: 6 additions & 0 deletions modules/api-svc/test/unit/inboundApi/handlers.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@

'use strict';

process.env.PEER_ENDPOINT = '172.17.0.3:4000';
process.env.BACKEND_ENDPOINT = '172.17.0.5:4000';
process.env.CACHE_URL = 'redis://172.17.0.2:6379';
process.env.MGMT_API_WS_URL = '0.0.0.0';
process.env.SUPPORTED_CURRENCIES='USD';

jest.mock('~/lib/model');

const handlers = require('~/InboundServer/handlers');
Expand Down
2 changes: 1 addition & 1 deletion modules/api-svc/test/unit/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ process.env.PEER_ENDPOINT = '172.17.0.3:4000';
process.env.BACKEND_ENDPOINT = '172.17.0.5:4000';
process.env.CACHE_URL = 'redis://172.17.0.2:6379';
process.env.MGMT_API_WS_URL = '0.0.0.0';
process.env.SUPPORTED_CURRENCIES="USD"
process.env.SUPPORTED_CURRENCIES='USD';

const index = require('~/index.js');

Expand Down
6 changes: 6 additions & 0 deletions modules/api-svc/test/unit/lib/model/AccountsModel.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@

'use strict';

process.env.PEER_ENDPOINT = '172.17.0.3:4000';
process.env.BACKEND_ENDPOINT = '172.17.0.5:4000';
process.env.CACHE_URL = 'redis://172.17.0.2:6379';
process.env.MGMT_API_WS_URL = '0.0.0.0';
process.env.SUPPORTED_CURRENCIES='USD';

// we use a mock standard components lib to intercept and mock certain funcs
jest.mock('@mojaloop/sdk-standard-components');
jest.mock('redis');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
**************************************************************************/
'use strict';

process.env.PEER_ENDPOINT = '172.17.0.3:4000';
process.env.BACKEND_ENDPOINT = '172.17.0.5:4000';
process.env.CACHE_URL = 'redis://172.17.0.2:6379';
process.env.MGMT_API_WS_URL = '0.0.0.0';
process.env.SUPPORTED_CURRENCIES='USD';

// we use a mock standard components lib to intercept and mock certain funcs
jest.mock('@mojaloop/sdk-standard-components');
jest.mock('redis');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@

'use strict';

process.env.PEER_ENDPOINT = '172.17.0.3:4000';
process.env.BACKEND_ENDPOINT = '172.17.0.5:4000';
process.env.CACHE_URL = 'redis://172.17.0.2:6379';
process.env.MGMT_API_WS_URL = '0.0.0.0';
process.env.SUPPORTED_CURRENCIES='USD';

// we use a mock standard components lib to intercept and mock certain funcs
jest.mock('@mojaloop/sdk-standard-components');
jest.mock('redis');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@

'use strict';

process.env.PEER_ENDPOINT = '172.17.0.3:4000';
process.env.BACKEND_ENDPOINT = '172.17.0.5:4000';
process.env.CACHE_URL = 'redis://172.17.0.2:6379';
process.env.MGMT_API_WS_URL = '0.0.0.0';
process.env.SUPPORTED_CURRENCIES='USD';

// we use a mock standard components lib to intercept and mock certain funcs
jest.mock('@mojaloop/sdk-standard-components');
jest.mock('redis');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@

'use strict';

process.env.PEER_ENDPOINT = '172.17.0.3:4000';
process.env.BACKEND_ENDPOINT = '172.17.0.5:4000';
process.env.CACHE_URL = 'redis://172.17.0.2:6379';
process.env.MGMT_API_WS_URL = '0.0.0.0';
process.env.SUPPORTED_CURRENCIES='USD';

// we use a mock standard components lib to intercept and mock certain funcs
jest.mock('@mojaloop/sdk-standard-components');
jest.mock('redis');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@

'use strict';

process.env.PEER_ENDPOINT = '172.17.0.3:4000';
process.env.BACKEND_ENDPOINT = '172.17.0.5:4000';
process.env.CACHE_URL = 'redis://172.17.0.2:6379';
process.env.MGMT_API_WS_URL = '0.0.0.0';
process.env.SUPPORTED_CURRENCIES='USD';

// we use a mock standard components lib to intercept and mock certain funcs
jest.mock('@mojaloop/sdk-standard-components');
jest.mock('redis');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@

'use strict';

process.env.PEER_ENDPOINT = '172.17.0.3:4000';
process.env.BACKEND_ENDPOINT = '172.17.0.5:4000';
process.env.CACHE_URL = 'redis://172.17.0.2:6379';
process.env.MGMT_API_WS_URL = '0.0.0.0';
process.env.SUPPORTED_CURRENCIES='USD';

// we use a mock standard components lib to intercept and mock certain funcs
jest.mock('@mojaloop/sdk-standard-components');
jest.mock('redis');
Expand Down
6 changes: 6 additions & 0 deletions modules/api-svc/test/unit/lib/model/PartiesModel.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@

'use strict';

process.env.PEER_ENDPOINT = '172.17.0.3:4000';
process.env.BACKEND_ENDPOINT = '172.17.0.5:4000';
process.env.CACHE_URL = 'redis://172.17.0.2:6379';
process.env.MGMT_API_WS_URL = '0.0.0.0';
process.env.SUPPORTED_CURRENCIES='USD';

// we use a mock standard components lib to intercept and mock certain funcs
jest.mock('@mojaloop/sdk-standard-components');

Expand Down
6 changes: 6 additions & 0 deletions modules/api-svc/test/unit/lib/model/QuotesModel.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@

'use strict';

process.env.PEER_ENDPOINT = '172.17.0.3:4000';
process.env.BACKEND_ENDPOINT = '172.17.0.5:4000';
process.env.CACHE_URL = 'redis://172.17.0.2:6379';
process.env.MGMT_API_WS_URL = '0.0.0.0';
process.env.SUPPORTED_CURRENCIES='USD';

// we use a mock standard components lib to intercept and mock certain funcs
jest.mock('@mojaloop/sdk-standard-components');

Expand Down
6 changes: 6 additions & 0 deletions modules/api-svc/test/unit/lib/model/TransfersModel.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@

'use strict';

process.env.PEER_ENDPOINT = '172.17.0.3:4000';
process.env.BACKEND_ENDPOINT = '172.17.0.5:4000';
process.env.CACHE_URL = 'redis://172.17.0.2:6379';
process.env.MGMT_API_WS_URL = '0.0.0.0';
process.env.SUPPORTED_CURRENCIES='USD';

// we use a mock standard components lib to intercept and mock certain funcs
jest.mock('@mojaloop/sdk-standard-components');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@

'use strict';

process.env.PEER_ENDPOINT = '172.17.0.3:4000';
process.env.BACKEND_ENDPOINT = '172.17.0.5:4000';
process.env.CACHE_URL = 'redis://172.17.0.2:6379';
process.env.MGMT_API_WS_URL = '0.0.0.0';
process.env.SUPPORTED_CURRENCIES='USD';

const Cache = jest.createMockFromModule('~/lib/cache');

const PSM = require('~/lib/model').PersistentStateMachine;
Expand Down
6 changes: 6 additions & 0 deletions modules/api-svc/test/unit/outboundApi/handlers.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@

'use strict';

process.env.PEER_ENDPOINT = '172.17.0.3:4000';
process.env.BACKEND_ENDPOINT = '172.17.0.5:4000';
process.env.CACHE_URL = 'redis://172.17.0.2:6379';
process.env.MGMT_API_WS_URL = '0.0.0.0';
process.env.SUPPORTED_CURRENCIES='USD';

const mockError = require('./data/mockError');
const mockBulkQuoteError = require('./data/mockBulkQuoteError');
const mockBulkTransferError = require('./data/mockBulkTransferError');
Expand Down
2 changes: 1 addition & 1 deletion modules/outbound-command-event-handler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"@types/convict": "^6.1.6",
"@types/express": "^4.17.21",
"@types/jest": "^29.5.12",
"@types/node": "^20.14.8",
"@types/node": "^20.14.9",
"@types/node-cache": "^4.2.5",
"@types/supertest": "^6.0.2",
"@types/swagger-ui-express": "^4.1.6",
Expand Down
2 changes: 1 addition & 1 deletion modules/outbound-domain-event-handler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"@types/convict": "^6.1.6",
"@types/express": "^4.17.21",
"@types/jest": "^29.5.12",
"@types/node": "^20.14.8",
"@types/node": "^20.14.9",
"@types/node-cache": "^4.2.5",
"@types/supertest": "^6.0.2",
"@types/swagger-ui-express": "^4.1.6",
Expand Down
2 changes: 1 addition & 1 deletion modules/private-shared-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"uuid": "^10.0.0"
},
"devDependencies": {
"@types/node": "^20.14.8",
"@types/node": "^20.14.9",
"@types/uuid": "^10.0.0",
"eslint": "^8.57.0",
"jest": "^29.7.0",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
},
"devDependencies": {
"@types/jest": "^29.5.12",
"@types/node": "^20.14.8",
"@types/node": "^20.14.9",
"@types/node-cache": "^4.2.5",
"@typescript-eslint/eslint-plugin": "^7.14.1",
"@typescript-eslint/parser": "^7.14.1",
Expand Down
Loading