smartdaemon/test/test.ts

27 lines
682 B
TypeScript
Raw Normal View History

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