Skip to content

Commit

Permalink
fix async
Browse files Browse the repository at this point in the history
  • Loading branch information
dangowans committed Jul 31, 2024
1 parent 367e5ac commit e82bcb9
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 32 deletions.
32 changes: 16 additions & 16 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const config = {
};
const cpaCodePropertyTaxes = '385';
await describe('eft-generator - CPA-005', async () => {
await it('Creates valid CPA-005 formatted output', async () => {
await it('Creates valid CPA-005 formatted output', () => {
const eftGenerator = new EFTGenerator(config);
assert.strictEqual(eftGenerator.getTransactions().length, 0);
eftGenerator.addTransaction({
Expand Down Expand Up @@ -76,7 +76,7 @@ await describe('eft-generator - CPA-005', async () => {
}
});
await describe('Configuration errors and warnings', async () => {
await it('Throws error when originatorId length is too long.', async () => {
await it('Throws error when originatorId length is too long.', () => {
const eftGenerator = new EFTGenerator({
originatorId: '12345678901234567890',
originatorLongName: '',
Expand All @@ -90,7 +90,7 @@ await describe('eft-generator - CPA-005', async () => {
assert.ok(true);
}
});
await it('Throws error when fileCreationNumber is invalid.', async () => {
await it('Throws error when fileCreationNumber is invalid.', () => {
const eftGenerator = new EFTGenerator({
originatorId: '1',
originatorLongName: '',
Expand All @@ -104,7 +104,7 @@ await describe('eft-generator - CPA-005', async () => {
assert.ok(true);
}
});
await it('Throws error when destinationDataCentre is invalid.', async () => {
await it('Throws error when destinationDataCentre is invalid.', () => {
const eftGenerator = new EFTGenerator({
originatorId: '1',
originatorLongName: 'Name',
Expand All @@ -119,7 +119,7 @@ await describe('eft-generator - CPA-005', async () => {
assert.ok(true);
}
});
await it('Throws error when destinationCurrency is invalid.', async () => {
await it('Throws error when destinationCurrency is invalid.', () => {
const eftGenerator = new EFTGenerator({
originatorId: '1',
originatorLongName: 'Name',
Expand All @@ -134,7 +134,7 @@ await describe('eft-generator - CPA-005', async () => {
assert.ok(true);
}
});
await it('Warns on missing originatorShortName', async () => {
await it('Warns on missing originatorShortName', () => {
const eftGenerator = new EFTGenerator({
originatorId: '01',
originatorLongName: 'This name exceeds the 30 character limit and will be truncated.',
Expand All @@ -144,7 +144,7 @@ await describe('eft-generator - CPA-005', async () => {
});
});
await describe('Transaction errors and warnings', async () => {
await it('Throws error when recordType is unsupported', async () => {
await it('Throws error when recordType is unsupported', () => {
const eftGenerator = new EFTGenerator(config);
eftGenerator.addTransaction({
recordType: 'E',
Expand All @@ -167,7 +167,7 @@ await describe('eft-generator - CPA-005', async () => {
assert.ok(true);
}
});
await it('Warns when there are no segments on a transaction.', async () => {
await it('Warns when there are no segments on a transaction.', () => {
const eftGenerator = new EFTGenerator(config);
eftGenerator.addTransaction({
recordType: 'D',
Expand All @@ -177,7 +177,7 @@ await describe('eft-generator - CPA-005', async () => {
const output = eftGenerator.toCPA005();
assert.ok(output.length > 0);
});
await it('Warns when there are more than six segments on a transaction.', async () => {
await it('Warns when there are more than six segments on a transaction.', () => {
const eftGenerator = new EFTGenerator(config);
eftGenerator.addTransaction({
recordType: 'D',
Expand Down Expand Up @@ -242,7 +242,7 @@ await describe('eft-generator - CPA-005', async () => {
});
assert.ok(eftGenerator.validateCPA005());
});
await it('Throws error when a transaction has a negative amount.', async () => {
await it('Throws error when a transaction has a negative amount.', () => {
const eftGenerator = new EFTGenerator(config);
eftGenerator.addDebitTransaction({
payeeName: 'Negative Amount',
Expand All @@ -254,7 +254,7 @@ await describe('eft-generator - CPA-005', async () => {
});
assert.ok(!eftGenerator.validateCPA005());
});
await it('Throws error when a transaction has too large of an amount', async () => {
await it('Throws error when a transaction has too large of an amount', () => {
const eftGenerator = new EFTGenerator(config);
eftGenerator.addDebitTransaction({
payeeName: 'Large Amount',
Expand All @@ -272,7 +272,7 @@ await describe('eft-generator - CPA-005', async () => {
assert.ok(true);
}
});
await it('Throws error when bankInstitutionNumber is invalid', async () => {
await it('Throws error when bankInstitutionNumber is invalid', () => {
const eftGenerator = new EFTGenerator(config);
eftGenerator.addDebitTransaction({
payeeName: 'Invalid Institution',
Expand All @@ -290,7 +290,7 @@ await describe('eft-generator - CPA-005', async () => {
assert.ok(true);
}
});
await it('Throws error when bankTransitNumber is invalid', async () => {
await it('Throws error when bankTransitNumber is invalid', () => {
const eftGenerator = new EFTGenerator(config);
eftGenerator.addDebitTransaction({
payeeName: 'Invalid Transit',
Expand All @@ -308,7 +308,7 @@ await describe('eft-generator - CPA-005', async () => {
assert.ok(true);
}
});
await it('Throws error when bankAccountNumber is invalid', async () => {
await it('Throws error when bankAccountNumber is invalid', () => {
const eftGenerator = new EFTGenerator(config);
eftGenerator.addDebitTransaction({
payeeName: 'Invalid Account',
Expand All @@ -326,7 +326,7 @@ await describe('eft-generator - CPA-005', async () => {
assert.ok(true);
}
});
await it('Warns when the payeeName is too long.', async () => {
await it('Warns when the payeeName is too long.', () => {
const eftGenerator = new EFTGenerator(config);
eftGenerator.addCreditTransaction({
payeeName: 'This payee name is too long and will be truncated to fit.',
Expand All @@ -338,7 +338,7 @@ await describe('eft-generator - CPA-005', async () => {
});
assert.ok(eftGenerator.validateCPA005());
});
await it('Warns when the crossReferenceNumber is duplicated.', async () => {
await it('Warns when the crossReferenceNumber is duplicated.', () => {
const eftGenerator = new EFTGenerator(config);
eftGenerator.addDebitTransaction({
payeeName: 'Same cross reference',
Expand Down
32 changes: 16 additions & 16 deletions test/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const config: EFTConfiguration = {
const cpaCodePropertyTaxes = '385'

await describe('eft-generator - CPA-005', async () => {
await it('Creates valid CPA-005 formatted output', async () => {
await it('Creates valid CPA-005 formatted output', () => {
const eftGenerator = new EFTGenerator(config)

assert.strictEqual(eftGenerator.getTransactions().length, 0)
Expand Down Expand Up @@ -92,7 +92,7 @@ await describe('eft-generator - CPA-005', async () => {
})

await describe('Configuration errors and warnings', async () => {
await it('Throws error when originatorId length is too long.', async () => {
await it('Throws error when originatorId length is too long.', () => {
const eftGenerator = new EFTGenerator({
originatorId: '12345678901234567890',
originatorLongName: '',
Expand All @@ -107,7 +107,7 @@ await describe('eft-generator - CPA-005', async () => {
}
})

await it('Throws error when fileCreationNumber is invalid.', async () => {
await it('Throws error when fileCreationNumber is invalid.', () => {
const eftGenerator = new EFTGenerator({
originatorId: '1',
originatorLongName: '',
Expand All @@ -122,7 +122,7 @@ await describe('eft-generator - CPA-005', async () => {
}
})

await it('Throws error when destinationDataCentre is invalid.', async () => {
await it('Throws error when destinationDataCentre is invalid.', () => {
const eftGenerator = new EFTGenerator({
originatorId: '1',
originatorLongName: 'Name',
Expand All @@ -138,7 +138,7 @@ await describe('eft-generator - CPA-005', async () => {
}
})

await it('Throws error when destinationCurrency is invalid.', async () => {
await it('Throws error when destinationCurrency is invalid.', () => {
const eftGenerator = new EFTGenerator({
originatorId: '1',
originatorLongName: 'Name',
Expand All @@ -154,7 +154,7 @@ await describe('eft-generator - CPA-005', async () => {
}
})

await it('Warns on missing originatorShortName', async () => {
await it('Warns on missing originatorShortName', () => {
const eftGenerator = new EFTGenerator({
originatorId: '01',
originatorLongName:
Expand All @@ -167,7 +167,7 @@ await describe('eft-generator - CPA-005', async () => {
})

await describe('Transaction errors and warnings', async () => {
await it('Throws error when recordType is unsupported', async () => {
await it('Throws error when recordType is unsupported', () => {
const eftGenerator = new EFTGenerator(config)

eftGenerator.addTransaction({
Expand All @@ -192,7 +192,7 @@ await describe('eft-generator - CPA-005', async () => {
}
})

await it('Warns when there are no segments on a transaction.', async () => {
await it('Warns when there are no segments on a transaction.', () => {
const eftGenerator = new EFTGenerator(config)

eftGenerator.addTransaction({
Expand All @@ -207,7 +207,7 @@ await describe('eft-generator - CPA-005', async () => {
assert.ok(output.length > 0)
})

await it('Warns when there are more than six segments on a transaction.', async () => {
await it('Warns when there are more than six segments on a transaction.', () => {
const eftGenerator = new EFTGenerator(config)

eftGenerator.addTransaction({
Expand Down Expand Up @@ -275,7 +275,7 @@ await describe('eft-generator - CPA-005', async () => {
assert.ok(eftGenerator.validateCPA005())
})

await it('Throws error when a transaction has a negative amount.', async () => {
await it('Throws error when a transaction has a negative amount.', () => {
const eftGenerator = new EFTGenerator(config)

eftGenerator.addDebitTransaction({
Expand All @@ -290,7 +290,7 @@ await describe('eft-generator - CPA-005', async () => {
assert.ok(!eftGenerator.validateCPA005())
})

await it('Throws error when a transaction has too large of an amount', async () => {
await it('Throws error when a transaction has too large of an amount', () => {
const eftGenerator = new EFTGenerator(config)

eftGenerator.addDebitTransaction({
Expand All @@ -310,7 +310,7 @@ await describe('eft-generator - CPA-005', async () => {
}
})

await it('Throws error when bankInstitutionNumber is invalid', async () => {
await it('Throws error when bankInstitutionNumber is invalid', () => {
const eftGenerator = new EFTGenerator(config)

eftGenerator.addDebitTransaction({
Expand All @@ -330,7 +330,7 @@ await describe('eft-generator - CPA-005', async () => {
}
})

await it('Throws error when bankTransitNumber is invalid', async () => {
await it('Throws error when bankTransitNumber is invalid', () => {
const eftGenerator = new EFTGenerator(config)

eftGenerator.addDebitTransaction({
Expand All @@ -350,7 +350,7 @@ await describe('eft-generator - CPA-005', async () => {
}
})

await it('Throws error when bankAccountNumber is invalid', async () => {
await it('Throws error when bankAccountNumber is invalid', () => {
const eftGenerator = new EFTGenerator(config)

eftGenerator.addDebitTransaction({
Expand All @@ -370,7 +370,7 @@ await describe('eft-generator - CPA-005', async () => {
}
})

await it('Warns when the payeeName is too long.', async () => {
await it('Warns when the payeeName is too long.', () => {
const eftGenerator = new EFTGenerator(config)

eftGenerator.addCreditTransaction({
Expand All @@ -385,7 +385,7 @@ await describe('eft-generator - CPA-005', async () => {
assert.ok(eftGenerator.validateCPA005())
})

await it('Warns when the crossReferenceNumber is duplicated.', async () => {
await it('Warns when the crossReferenceNumber is duplicated.', () => {
const eftGenerator = new EFTGenerator(config)

eftGenerator.addDebitTransaction({
Expand Down

0 comments on commit e82bcb9

Please sign in to comment.