mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-20 12:15:51 +00:00
Lints test/models (#1578)
This commit is contained in:
15
.eslintrc.js
15
.eslintrc.js
@@ -90,6 +90,21 @@ module.exports = {
|
|||||||
|
|
||||||
// We need to mess with internal things to generate certain testing situations
|
// We need to mess with internal things to generate certain testing situations
|
||||||
"@typescript-eslint/no-unsafe-member-access": "off",
|
"@typescript-eslint/no-unsafe-member-access": "off",
|
||||||
|
|
||||||
|
// We need to be able to import xrpl-local
|
||||||
|
"node/no-extraneous-import": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
allowModules: ["xrpl-local"],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ["test/models/*.ts"],
|
||||||
|
rules: {
|
||||||
|
"@typescript-eslint/consistent-type-assertions": "off",
|
||||||
|
"@typescript-eslint/no-explicit-any": "off",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ describe("AccountSet", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it(`throws w/ invalid EmailHash`, function () {
|
it(`throws w/ invalid EmailHash`, function () {
|
||||||
account.EmailHash = 657861645678909876543456789876543;
|
account.EmailHash = 6578656789876543;
|
||||||
|
|
||||||
assert.throws(
|
assert.throws(
|
||||||
() => verifyAccountSet(account),
|
() => verifyAccountSet(account),
|
||||||
@@ -80,7 +80,7 @@ describe("AccountSet", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it(`throws w/ invalid MessageKey`, function () {
|
it(`throws w/ invalid MessageKey`, function () {
|
||||||
account.MessageKey = 65786165678908765456789567890678;
|
account.MessageKey = 6578656789876543;
|
||||||
|
|
||||||
assert.throws(
|
assert.throws(
|
||||||
() => verifyAccountSet(account),
|
() => verifyAccountSet(account),
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ describe("CheckCancel", function () {
|
|||||||
const invalidCheckID = {
|
const invalidCheckID = {
|
||||||
Account: "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
|
Account: "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
|
||||||
TransactionType: "CheckCancel",
|
TransactionType: "CheckCancel",
|
||||||
CheckID: 496473456789876545678909876545678,
|
CheckID: 4964734566545678,
|
||||||
} as any;
|
} as any;
|
||||||
|
|
||||||
assert.throws(
|
assert.throws(
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ describe("CheckCash", function () {
|
|||||||
Account: "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
|
Account: "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
|
||||||
TransactionType: "CheckCash",
|
TransactionType: "CheckCash",
|
||||||
Amount: "100000000",
|
Amount: "100000000",
|
||||||
CheckID: 83876645678909854567890,
|
CheckID: 83876645678567890,
|
||||||
} as any;
|
} as any;
|
||||||
|
|
||||||
assert.throws(
|
assert.throws(
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ describe("CheckCreate", function () {
|
|||||||
const invalidDestination = {
|
const invalidDestination = {
|
||||||
TransactionType: "CheckCreate",
|
TransactionType: "CheckCreate",
|
||||||
Account: "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
|
Account: "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
|
||||||
Destination: 7896214563214789632154,
|
Destination: 7896214789632154,
|
||||||
SendMax: "100000000",
|
SendMax: "100000000",
|
||||||
Expiration: 570113521,
|
Expiration: 570113521,
|
||||||
InvoiceID:
|
InvoiceID:
|
||||||
@@ -113,7 +113,7 @@ describe("CheckCreate", function () {
|
|||||||
Destination: "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
|
Destination: "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
|
||||||
SendMax: "100000000",
|
SendMax: "100000000",
|
||||||
Expiration: 570113521,
|
Expiration: 570113521,
|
||||||
InvoiceID: 7896545655285446963258531,
|
InvoiceID: 789656963258531,
|
||||||
DestinationTag: 1,
|
DestinationTag: 1,
|
||||||
Fee: "12",
|
Fee: "12",
|
||||||
} as any;
|
} as any;
|
||||||
|
|||||||
@@ -107,8 +107,8 @@ describe("Payment", function () {
|
|||||||
|
|
||||||
it(`verifies valid DeliverMin with tfPartialPayment flag set as a number`, function () {
|
it(`verifies valid DeliverMin with tfPartialPayment flag set as a number`, function () {
|
||||||
paymentTransaction.DeliverMin = "10000";
|
paymentTransaction.DeliverMin = "10000";
|
||||||
(paymentTransaction.Flags = PaymentTransactionFlagsEnum.tfPartialPayment),
|
paymentTransaction.Flags = PaymentTransactionFlagsEnum.tfPartialPayment;
|
||||||
assert.doesNotThrow(() => verifyPayment(paymentTransaction));
|
assert.doesNotThrow(() => verifyPayment(paymentTransaction));
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`verifies valid DeliverMin with tfPartialPayment flag set as a boolean`, function () {
|
it(`verifies valid DeliverMin with tfPartialPayment flag set as a boolean`, function () {
|
||||||
|
|||||||
Reference in New Issue
Block a user