mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2024-12-20 06:07:57 +00:00
37feb7e325
Closes: #1049 Change-type: patch Signed-off-by: Cameron Diver <cameron@balena.io>
36 lines
880 B
TypeScript
36 lines
880 B
TypeScript
process.env.ROOT_MOUNTPOINT = './test/data';
|
|
process.env.BOOT_MOUNTPOINT = '/mnt/boot';
|
|
process.env.CONFIG_JSON_PATH = '/config.json';
|
|
process.env.DATABASE_PATH = './test/data/database.sqlite';
|
|
process.env.DATABASE_PATH_2 = './test/data/database2.sqlite';
|
|
process.env.DATABASE_PATH_3 = './test/data/database3.sqlite';
|
|
process.env.LED_FILE = './test/data/led_file';
|
|
|
|
import { stub } from 'sinon';
|
|
|
|
import * as dbus from 'dbus';
|
|
|
|
// Stub the dbus objects to dynamically generate the methods
|
|
// on request
|
|
stub(dbus, 'getBus').returns({
|
|
getInterface: (
|
|
_obj: unknown,
|
|
cb: (err: Error | undefined, iface: dbus.DBusInterface) => void,
|
|
) => {
|
|
return cb(
|
|
undefined,
|
|
new Proxy(
|
|
{},
|
|
{
|
|
get(_target, name) {
|
|
console.log(`Dbus method ${String(name)} requested`);
|
|
return () => {
|
|
/* noop */
|
|
};
|
|
},
|
|
},
|
|
) as any,
|
|
);
|
|
},
|
|
} as any);
|