Lints test/models (#1578)

This commit is contained in:
Mayukha Vadari
2021-09-02 20:42:17 -05:00
parent 3f365d8591
commit 2ca164311b
6 changed files with 23 additions and 8 deletions

View File

@@ -90,6 +90,21 @@ module.exports = {
// We need to mess with internal things to generate certain testing situations
"@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",
},
},
{

View File

@@ -70,7 +70,7 @@ describe("AccountSet", function () {
});
it(`throws w/ invalid EmailHash`, function () {
account.EmailHash = 657861645678909876543456789876543;
account.EmailHash = 6578656789876543;
assert.throws(
() => verifyAccountSet(account),
@@ -80,7 +80,7 @@ describe("AccountSet", function () {
});
it(`throws w/ invalid MessageKey`, function () {
account.MessageKey = 65786165678908765456789567890678;
account.MessageKey = 6578656789876543;
assert.throws(
() => verifyAccountSet(account),

View File

@@ -25,7 +25,7 @@ describe("CheckCancel", function () {
const invalidCheckID = {
Account: "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
TransactionType: "CheckCancel",
CheckID: 496473456789876545678909876545678,
CheckID: 4964734566545678,
} as any;
assert.throws(

View File

@@ -28,7 +28,7 @@ describe("CheckCash", function () {
Account: "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
TransactionType: "CheckCash",
Amount: "100000000",
CheckID: 83876645678909854567890,
CheckID: 83876645678567890,
} as any;
assert.throws(

View File

@@ -30,7 +30,7 @@ describe("CheckCreate", function () {
const invalidDestination = {
TransactionType: "CheckCreate",
Account: "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
Destination: 7896214563214789632154,
Destination: 7896214789632154,
SendMax: "100000000",
Expiration: 570113521,
InvoiceID:
@@ -113,7 +113,7 @@ describe("CheckCreate", function () {
Destination: "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
SendMax: "100000000",
Expiration: 570113521,
InvoiceID: 7896545655285446963258531,
InvoiceID: 789656963258531,
DestinationTag: 1,
Fee: "12",
} as any;

View File

@@ -107,7 +107,7 @@ describe("Payment", function () {
it(`verifies valid DeliverMin with tfPartialPayment flag set as a number`, function () {
paymentTransaction.DeliverMin = "10000";
(paymentTransaction.Flags = PaymentTransactionFlagsEnum.tfPartialPayment),
paymentTransaction.Flags = PaymentTransactionFlagsEnum.tfPartialPayment;
assert.doesNotThrow(() => verifyPayment(paymentTransaction));
});