Fixes
- Added Actual account ids and log level to .env.example. - Fixed timestamp error by downloading the budget after init. - Hardcoded date in test. - Separate logging file for configurations. - Organized test - More logging in main - Fixed wrong paths for some files - Load a .env.test.local file when running tests Signed-off-by: Martin Berg Alstad <git@martials.no>
This commit is contained in:
@ -1,12 +1,16 @@
|
||||
import { describe, expect, it } from "@jest/globals"
|
||||
import { describe, it } from "@jest/globals"
|
||||
|
||||
import { daily } from "@/main.ts"
|
||||
import { ActualImpl } from "@/actual.ts"
|
||||
import { BankStub } from "./stubs/bankStub.ts"
|
||||
|
||||
// TODO testcontainers with Actual?
|
||||
// TODO tests don't stop after completing
|
||||
|
||||
describe("Main logic of the application", () => {
|
||||
it("should import the transactions to Actual Budget", async () => {
|
||||
await daily(await ActualImpl.init(), new BankStub())
|
||||
expect(true)
|
||||
const actual = await ActualImpl.init()
|
||||
await daily(actual, new BankStub())
|
||||
await actual.shutdown()
|
||||
})
|
||||
})
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type { Bank, OAuthTokenResponse, Transaction } from "@/sparebank1.ts"
|
||||
import type { Bank, OAuthTokenResponse, Transaction } from "@/bank/sparebank1.ts"
|
||||
|
||||
const tokenResponse: OAuthTokenResponse = {
|
||||
access_token: "my_access_token",
|
||||
@ -23,7 +23,7 @@ export class BankStub implements Bank {
|
||||
_accessToken: string,
|
||||
): Promise<ReadonlyArray<Transaction>> {
|
||||
const someFields = {
|
||||
date: new Date().toDateString(),
|
||||
date: "2019-08-20",
|
||||
description: "Test transaction",
|
||||
cleanedDescription: "Test transaction",
|
||||
remoteAccountName: "Test account",
|
||||
|
Reference in New Issue
Block a user