2023-05-05 05:29:08 +00:00
|
|
|
// @ts-check
|
|
|
|
|
2023-08-18 05:00:40 +00:00
|
|
|
const fs = require("fs")
|
2023-05-05 05:29:08 +00:00
|
|
|
const sqlite = require("better-sqlite3")
|
|
|
|
const HeatSync = require("heatsync")
|
|
|
|
|
|
|
|
const config = require("../config")
|
|
|
|
const passthrough = require("../passthrough")
|
2023-08-18 05:00:40 +00:00
|
|
|
const db = new sqlite(":memory:")
|
|
|
|
|
|
|
|
db.exec(fs.readFileSync("db/data-for-test.sql", "utf8"))
|
2023-05-05 05:29:08 +00:00
|
|
|
|
2023-05-08 05:22:20 +00:00
|
|
|
const sync = new HeatSync({watchFS: false})
|
2023-05-05 05:29:08 +00:00
|
|
|
|
|
|
|
Object.assign(passthrough, { config, sync, db })
|
|
|
|
|
2023-08-18 05:00:40 +00:00
|
|
|
const file = sync.require("../matrix/file")
|
|
|
|
file._actuallyUploadDiscordFileToMxc = function(url, res) { throw new Error(`Not allowed to upload files during testing.\nURL: ${url}`) }
|
|
|
|
|
2023-05-10 05:40:31 +00:00
|
|
|
require("../matrix/kstate.test")
|
|
|
|
require("../matrix/api.test")
|
2023-05-09 03:29:46 +00:00
|
|
|
require("../matrix/read-registration.test")
|
2023-05-12 05:35:37 +00:00
|
|
|
require("../d2m/converters/message-to-event.test")
|
2023-08-19 10:54:23 +00:00
|
|
|
require("../d2m/converters/message-to-event.embeds.test")
|
2023-08-16 05:03:05 +00:00
|
|
|
require("../d2m/converters/edit-to-changes.test")
|
2023-05-05 13:25:15 +00:00
|
|
|
require("../d2m/actions/create-room.test")
|
2023-05-08 12:58:46 +00:00
|
|
|
require("../d2m/converters/user-to-mxid.test")
|
2023-06-30 03:15:34 +00:00
|
|
|
require("../d2m/actions/register-user.test")
|
2023-07-02 13:06:05 +00:00
|
|
|
require("../m2d/converters/event-to-message.test")
|
2023-07-03 12:39:42 +00:00
|
|
|
require("../m2d/converters/utils.test")
|