-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.mjs
32 lines (25 loc) · 870 Bytes
/
test.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// @ts-check
import TestDirector from "test-director";
import test_animateScroll from "./animateScroll.test.mjs";
import test_easeInOutCubic from "./easeInOutCubic.test.mjs";
import test_scrollToElement from "./scrollToElement.test.mjs";
import servePackageFiles from "./test/servePackageFiles.mjs";
async function test() {
const packageFilesServer = await servePackageFiles(
new URL(".", import.meta.url)
);
const { port } = /** @type {import("node:net").AddressInfo} */ (
packageFilesServer.address()
);
const packageFilesOriginUrl = new URL(`http://localhost:${port}/`);
try {
const tests = new TestDirector();
test_animateScroll(tests, packageFilesOriginUrl);
test_easeInOutCubic(tests);
test_scrollToElement(tests, packageFilesOriginUrl);
await tests.run();
} finally {
packageFilesServer.close();
}
}
test();