[ci] format

This commit is contained in:
natemoo-re 2023-08-15 17:13:43 +00:00 committed by astrobot-houston
parent 74df833708
commit a37b2242d0
2 changed files with 19 additions and 9 deletions

View file

@ -31,7 +31,10 @@ describe('Cf metadata and caches', () => {
let html = await res.text(); let html = await res.text();
let $ = cheerio.load(html); let $ = cheerio.load(html);
expect($('#cf').text()).to.contain('city', `Expected "city" to exist in runtime, but got ${$('#cf').text()}`); expect($('#cf').text()).to.contain(
'city',
`Expected "city" to exist in runtime, but got ${$('#cf').text()}`
);
expect($('#hasCache').text()).to.equal('true'); expect($('#hasCache').text()).to.equal('true');
}); });
}); });

View file

@ -33,7 +33,17 @@ export async function runCLI(basePath, { silent, port }) {
} }
const script = fileURLToPath(new URL(`${basePath}/dist/_worker.js`, import.meta.url)); const script = fileURLToPath(new URL(`${basePath}/dist/_worker.js`, import.meta.url));
const p = spawn('node', [wranglerPath, 'dev', script, '--port', port, '--log-level', 'info', '--persist-to', `${basePath}/.wrangler/state`]); const p = spawn('node', [
wranglerPath,
'dev',
script,
'--port',
port,
'--log-level',
'info',
'--persist-to',
`${basePath}/.wrangler/state`,
]);
p.stderr.setEncoding('utf-8'); p.stderr.setEncoding('utf-8');
p.stdout.setEncoding('utf-8'); p.stdout.setEncoding('utf-8');
@ -41,13 +51,10 @@ export async function runCLI(basePath, { silent, port }) {
const timeout = 10_000; const timeout = 10_000;
const ready = new Promise(async (resolve, reject) => { const ready = new Promise(async (resolve, reject) => {
const failed = setTimeout( const failed = setTimeout(() => {
() => { p.kill();
p.kill(); reject(new Error(`Timed out starting the wrangler CLI`));
reject(new Error(`Timed out starting the wrangler CLI`)); }, timeout);
},
timeout
);
(async function () { (async function () {
for (const msg of p.stderr) { for (const msg of p.stderr) {