You've already forked tf2wikipricing
18 lines
460 B
TypeScript
18 lines
460 B
TypeScript
import { describe, expect, test, jest, mock, beforeEach } from "bun:test";
|
|
import { convertTF2PriceToUSD } from '../src/content/utils/currency'
|
|
|
|
mock.module('../src/content/config', () => ({
|
|
conversion_ref_usd: 0.05 // Mock conversion rate
|
|
}))
|
|
|
|
|
|
describe('Currency Service', () => {
|
|
beforeEach(() => {
|
|
jest.clearAllMocks()
|
|
});
|
|
|
|
test('convertTF2PriceToUSD returns correct price', () => {
|
|
expect(convertTF2PriceToUSD(1, 10, 50)).toBe(3);
|
|
})
|
|
})
|