fix(core): update
This commit is contained in:
11
test/index.html
Normal file
11
test/index.html
Normal file
@ -0,0 +1,11 @@
|
||||
<head>
|
||||
<title>An Awesome Test Page</title>
|
||||
<style>
|
||||
body {
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
This is a test page!
|
||||
</body>
|
30
test/test.ts
Normal file
30
test/test.ts
Normal file
@ -0,0 +1,30 @@
|
||||
import { tap, expect } from '@pushrocks/tapbundle';
|
||||
import * as smartpath from '@pushrocks/smartpath';
|
||||
|
||||
import { TypedServer } from '../ts/index.js';
|
||||
|
||||
let testTypedServer: TypedServer;
|
||||
tap.test('should create a valid instance of TypedServer', async () => {
|
||||
testTypedServer = new TypedServer({
|
||||
injectReload: true,
|
||||
port: 3000,
|
||||
serveDir: smartpath.get.dirnameFromImportMetaUrl(import.meta.url),
|
||||
watch: true,
|
||||
});
|
||||
expect(testTypedServer).toBeInstanceOf(TypedServer);
|
||||
});
|
||||
|
||||
tap.test('should start to serve files', async (tools) => {
|
||||
await testTypedServer.start();
|
||||
await tools.delayFor(5000);
|
||||
await testTypedServer.reload();
|
||||
await tools.delayFor(5000);
|
||||
await testTypedServer.reload();
|
||||
});
|
||||
|
||||
tap.test('should stop to serve files ', async (tools) => {
|
||||
await tools.delayFor(5000);
|
||||
await testTypedServer.stop();
|
||||
});
|
||||
|
||||
tap.start();
|
Reference in New Issue
Block a user