fix(core): initial
This commit is contained in:
29
test/test.ts
29
test/test.ts
@ -1,8 +1,33 @@
|
||||
import { expect, tap } from '@pushrocks/tapbundle';
|
||||
import * as smartvhost from '../ts/index';
|
||||
import { SmartVHost } from '../ts/index';
|
||||
|
||||
tap.test('first test', async () => {
|
||||
console.log(smartvhost.standardExport);
|
||||
import * as path from 'path';
|
||||
|
||||
let testSmartVHost: smartvhost.SmartVHost;
|
||||
|
||||
tap.test('should create a valid instance of smartvhost', async () => {
|
||||
testSmartVHost = new smartvhost.SmartVHost();
|
||||
expect(testSmartVHost).to.be.instanceOf(smartvhost.SmartVHost);
|
||||
});
|
||||
|
||||
tap.test('should start smartvhost', async () => {
|
||||
await testSmartVHost.start();
|
||||
|
||||
});
|
||||
|
||||
tap.test('should accept a config array', async () => {
|
||||
testSmartVHost.setVHostConfigs([{
|
||||
hostName: 'example.com',
|
||||
privateKey: '',
|
||||
publicKey: '',
|
||||
type: 'folder',
|
||||
target: path.join(__dirname, 'testservedir')
|
||||
}]);
|
||||
});
|
||||
|
||||
tap.test('should stop smartvhost', async () => {
|
||||
await testSmartVHost.stop();
|
||||
});
|
||||
|
||||
tap.start();
|
||||
|
1
test/testservedir/hello.md
Normal file
1
test/testservedir/hello.md
Normal file
@ -0,0 +1 @@
|
||||
# Hello
|
Reference in New Issue
Block a user