Skip to content

Commit

Permalink
chore: made biome happy
Browse files Browse the repository at this point in the history
  • Loading branch information
lmammino committed Feb 28, 2024
1 parent b5d4bec commit 605dd91
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 48 deletions.
23 changes: 5 additions & 18 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,21 @@
"all": true
}
},
"ignore": [
"coverage/",
"dist/",
"node_modules/"
]
"ignore": ["coverage/", "dist/", "node_modules/", "docs/"]
},
"formatter": {
"enabled": true,
"formatWithErrors": false,
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 80,
"ignore": [
"coverage/",
"dist/",
"node_modules/"
]
"ignore": ["coverage/", "dist/", "node_modules/", "docs/"]
},
"javascript": {
"formatter": {
"semicolons": "asNeeded",
"quoteStyle": "single"
}
"globals": [
"Deno",
"describe",
"test",
"expect"
]
},
"globals": ["Deno", "describe", "test", "expect", "it"]
}
}
}
2 changes: 1 addition & 1 deletion test/bun.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect, test } from "bun:test"
import { expect, test } from 'bun:test'
import {
fv,
pmt,
Expand Down
14 changes: 2 additions & 12 deletions test/deno.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
import { assertEquals } from 'https://deno.land/std/assert/mod.ts'
import {
fv,
pmt,
nper,
ipmt,
pv,
irr,
npv,
} from '../src/index.ts'
import { fv, pmt, nper, ipmt, pv, irr, npv } from '../src/index.ts'

Deno.test('fv()', () => {
assertEquals(fv(0.05 / 12, 10 * 12, -100, -100), 15692.928894335755)
Expand All @@ -24,9 +16,7 @@ Deno.test('nper()', () => {
Deno.test('ipmt()', () => {
const principal = 2500
const periods = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
const ipmts = periods.map((per) =>
ipmt(0.0824 / 12, per, 1 * 12, principal),
)
const ipmts = periods.map((per) => ipmt(0.0824 / 12, per, 1 * 12, principal))
assertEquals(
ipmts,
[
Expand Down
20 changes: 3 additions & 17 deletions test/examples.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
import {
fv,
pmt,
nper,
ipmt,
pv,
irr,
npv,
} from '../src/index.ts'
import { fv, pmt, nper, ipmt, pv, irr, npv } from '../src/index.ts'

describe('Source code docs examples', () => {
test('fv()', () => {
Expand All @@ -17,10 +9,7 @@ describe('Source code docs examples', () => {
})

test('pmt()', () => {
expect(pmt(0.075 / 12, 12 * 15, 200000)).toBeCloseTo(
-1854.0247200054619,
6,
)
expect(pmt(0.075 / 12, 12 * 15, 200000)).toBeCloseTo(-1854.0247200054619, 6)
})

test('nper()', () => {
Expand Down Expand Up @@ -65,9 +54,6 @@ describe('Source code docs examples', () => {

const initialCashflow = cashflows[0]
cashflows[0] = 0
expect(npv(rate, cashflows) + initialCashflow).toBeCloseTo(
3065.22266817,
6,
)
expect(npv(rate, cashflows) + initialCashflow).toBeCloseTo(3065.22266817, 6)
})
})

0 comments on commit 605dd91

Please sign in to comment.