mirror of
https://github.com/ant-design/ant-design.git
synced 2025-07-26 08:47:29 +08:00
Merge branch 'master' into master-merge-feature
This commit is contained in:
commit
00d74a30fc
@ -3,7 +3,7 @@
|
|||||||
import type http from 'http';
|
import type http from 'http';
|
||||||
import type https from 'https';
|
import type https from 'https';
|
||||||
import { join } from 'path';
|
import { join } from 'path';
|
||||||
import cheerio from 'cheerio';
|
import { load } from 'cheerio';
|
||||||
import { globSync } from 'glob';
|
import { globSync } from 'glob';
|
||||||
import { createServer } from 'http-server';
|
import { createServer } from 'http-server';
|
||||||
import fetch from 'isomorphic-fetch';
|
import fetch from 'isomorphic-fetch';
|
||||||
@ -20,9 +20,9 @@ describe('site test', () => {
|
|||||||
const port = 3000;
|
const port = 3000;
|
||||||
const render = async (path: string) => {
|
const render = async (path: string) => {
|
||||||
const resp = await fetch(`http://127.0.0.1:${port}${path}`).then(async (res) => {
|
const resp = await fetch(`http://127.0.0.1:${port}${path}`).then(async (res) => {
|
||||||
const html = await res.text();
|
const html: string = await res.text();
|
||||||
const $ = cheerio.load(html, { decodeEntities: false, recognizeSelfClosing: true });
|
const $ = load(html, { decodeEntities: false, recognizeSelfClosing: true });
|
||||||
return { html, status: res.status, $ };
|
return { status: res.status, $ };
|
||||||
});
|
});
|
||||||
return resp;
|
return resp;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user