feat: replace <request> with <rock-req>

This commit is contained in:
nanov
2023-10-11 22:15:35 +03:00
parent a03ec2283f
commit b6b27516d5
7 changed files with 161 additions and 128 deletions

View File

@@ -1,19 +1,19 @@
"use strict";
'use strict';
/* eslint-env node, mocha */
const { assert } = require("chai");
const { assert } = require('chai');
const path = require("path");
const fs = require("fs");
const path = require('path');
const fs = require('fs');
const ebics = require("../../");
const ebics = require('../../');
const libxml = require("libxmljs");
const libxml = require('libxmljs');
const schemaPath = path.resolve(__dirname, "../xsd/ebics_H004.xsd");
const schemaPath = path.resolve(__dirname, '../xsd/ebics_H004.xsd');
const schemaDoc = libxml.parseXml(
fs.readFileSync(schemaPath, { encoding: "utf8" })
fs.readFileSync(schemaPath, { encoding: 'utf8' }),
);
const schemaDir = path.dirname(schemaPath);
@@ -32,13 +32,13 @@ const validateXML = (str) => {
};
const client = new ebics.Client({
url: "https://iso20022test.credit-suisse.com/ebicsweb/ebicsweb",
partnerId: "CRS04381",
userId: "CRS04381",
hostId: "CRSISOTB",
passphrase: "test",
url: 'https://iso20022test.credit-suisse.com/ebicsweb/ebicsweb',
partnerId: 'CRS04381',
userId: 'CRS04381',
hostId: 'CRSISOTB',
passphrase: 'test',
keyStorage: ebics.fsKeysStorage(
path.resolve(__dirname, "../support/TEST_KEYS.key")
path.resolve(__dirname, '../support/TEST_KEYS.key'),
),
});
@@ -56,8 +56,8 @@ const CCS = require('./CCS');
const XE3 = require('./XE3');
const XCT = require('./XCT');
*/
const uploadBuilder = (fn) => fn("");
const dateBuilder = (fn) => fn("2018-01-01", "2019-01-01");
const uploadBuilder = fn => fn('');
const dateBuilder = fn => fn('2018-01-01', '2019-01-01');
const fnOrders = {
// upload | document
@@ -87,12 +87,12 @@ const fnOrders = {
};
const getOrderObject = (name, order) => {
if (typeof order === "object") return order;
if (typeof order === 'object') return order;
if (fnOrders[name]) return fnOrders[name](order);
return null;
};
describe("H004 order generation", () => {
describe('H004 order generation', () => {
// eslint-disable-next-line no-restricted-syntax
for (const [name, orderDefinition] of Object.entries(Orders)) {
const order = getOrderObject(name, orderDefinition);