smartdaemon/test/test.ts

27 lines
682 B
TypeScript
Raw Normal View History

2019-06-20 14:01:51 +02:00
import { expect, tap } from '@pushrocks/tapbundle';
2022-10-19 19:27:42 +02:00
import * as plugins from './plugins.js';
import * as smartdaemon from '../ts/index.js';
2019-06-20 14:01:51 +02:00
2019-09-03 15:21:30 +02:00
let testSmartdaemon: smartdaemon.SmartDaemon;
tap.test('should create an instance of smartdaemon', async () => {
testSmartdaemon = new smartdaemon.SmartDaemon();
2022-10-19 19:27:42 +02:00
expect(testSmartdaemon).toBeInstanceOf(smartdaemon.SmartDaemon);
2019-06-20 14:01:51 +02:00
});
2019-09-03 22:09:30 +02:00
tap.test('should create a service', async () => {
testSmartdaemon.addService({
2019-09-05 11:15:17 +02:00
name: 'npmversion',
version: 'x.x.x',
2019-09-03 22:09:30 +02:00
command: 'npm -v',
description: 'displays the npm version',
2022-10-19 19:27:42 +02:00
workingDir: plugins.smartpath.get.dirnameFromImportMetaUrl(import.meta.url),
2019-09-03 22:09:30 +02:00
});
});
2019-06-20 14:01:51 +02:00
tap.start();