import test from 'ava';
import { getDisplays, loggedIn } from '../index.js';

const sleep = (time) => new Promise((res) => setTimeout(res, time));

test('sum from native', async (t) => {
	let displays = getDisplays();
	const pp = `\n${new Date().toISOString()} - ${JSON.stringify(displays)}`;
	// await fs.promises.appendFile("C:/Temp/childbirths.txt", pp);
	console.log(pp);

	let loggedInVar = loggedIn();
	const pp1 = `\n${new Date().toISOString()} - ${JSON.stringify(loggedInVar)}`;
	// await fs.promises.appendFile("C:/Temp/childbirths_logged.txt", pp1);
	console.log(pp1);

	await sleep(1000);

	t.is(true, true);
});
