Skip to content

Commit 165b266

Browse files
committed
【同步】更新开发依赖库
1 parent af9c719 commit 165b266

34 files changed

+8293
-11006
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
node_modules/*
1+
node_modules/
2+
package-lock.json

.npmignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.editorconfig
2+
build/
3+
docs/
4+
test/

build/TestKit.js

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
11
'use strict';
22

3-
const Path = require('path'),
4-
HTMLPages = require('html-pages'),
5-
Chromy = require('chromy');
3+
const WebServer = require('koapache').default, Chromy = require('chromy');
64

7-
8-
// 静态文件服务器
9-
10-
const server = HTMLPages(process.cwd(), {
11-
'log-level': 'warn'
12-
});
5+
var server;
136

147

158
// 退出前清理 服务器、浏览器
@@ -18,8 +11,6 @@ async function exit(code) {
1811

1912
await Chromy.cleanup();
2013

21-
server.stop();
22-
2314
if (code !== 0) process.exit(code || 1);
2415
};
2516

@@ -40,7 +31,11 @@ exports.chrome = new Chromy();
4031

4132
exports.pageLoad = async function (sourceURI) {
4233

43-
await exports.chrome.goto('http://localhost:8084/test/unit.html');
34+
server = server || await (new WebServer()).workerHost();
35+
36+
await exports.chrome.goto(
37+
`http://${server.address}:${server.port}/test/unit.html`
38+
);
4439

4540
await exports.chrome.evaluate(function () {
4641

0 commit comments

Comments
 (0)