fix: add more tests for completeness (#59610)

This commit is contained in:
Rywin Patcharaput
2025-04-08 06:27:28 -04:00
committed by GitHub
parent 0412ac5d41
commit f94a944c4e

View File

@@ -19,18 +19,28 @@ Your `getLoanMessage` function should return a string.
```js
assert.isString(getLoanMessage(65000, 750));
assert.isString(getLoanMessage(60000, 750));
assert.isString(getLoanMessage(65000, 700));
assert.isString(getLoanMessage(60000, 700));
```
Your `getLoanMessage` function should return the string `"You qualify for a duplex, condo, and car loan."`.
```js
assert.strictEqual(getLoanMessage(65000, 750), "You qualify for a duplex, condo, and car loan.");
assert.strictEqual(getLoanMessage(60000, 750), "You qualify for a duplex, condo, and car loan.");
assert.strictEqual(getLoanMessage(65000, 700), "You qualify for a duplex, condo, and car loan.");
assert.strictEqual(getLoanMessage(60000, 700), "You qualify for a duplex, condo, and car loan.");
```
Your `getLoanMessage` function should return `undefined` if the applicant's annual income and credit score do not meet the requirements for a duplex loan.
```js
assert.strictEqual(getLoanMessage(59000, 700), undefined);
assert.isUndefined(getLoanMessage(59000, 690));
assert.isUndefined(getLoanMessage(59000, 700));
assert.isUndefined(getLoanMessage(59000, 750));
assert.isUndefined(getLoanMessage(60000, 690));
assert.isUndefined(getLoanMessage(65000, 690));
```
# --seed--