import { expect, tap } from '@git.zone/tstest/tapbundle'; import * as plugins from './plugins.js'; import * as smartdaemon from '../ts/index.js'; let testSmartdaemon: smartdaemon.SmartDaemon; tap.test('should create an instance of smartdaemon', async () => { testSmartdaemon = new smartdaemon.SmartDaemon(); expect(testSmartdaemon).toBeInstanceOf(smartdaemon.SmartDaemon); }); tap.test('should create a service', async () => { testSmartdaemon.systemdManager.getServices = async () => []; testSmartdaemon.systemdManager.saveService = async () => {}; const testService = await testSmartdaemon.addService({ name: 'npmversion', version: 'x.x.x', command: 'npm -v', description: 'displays the npm version', workingDir: plugins.smartpath.get.dirnameFromImportMetaUrl(import.meta.url), }); expect(testService.name).toEqual('npmversion'); }); export default tap.start();