[ci] format

This commit is contained in:
matthewp 2022-07-27 20:17:38 +00:00 committed by fredkbot
parent a198028b04
commit 3a599f2144
3 changed files with 18 additions and 14 deletions

View file

@ -75,8 +75,8 @@ export default function createIntegration(): AstroIntegration {
bundle: true, bundle: true,
minify: true, minify: true,
banner: { banner: {
js: SHIM js: SHIM,
} },
}); });
// throw the server folder in the bin // throw the server folder in the bin

View file

@ -29,4 +29,3 @@ describe('Basic app', () => {
} }
}); });
}); });

View file

@ -11,7 +11,9 @@ export function loadFixture(config) {
return baseLoadFixture(config); return baseLoadFixture(config);
} }
const wranglerPath = fileURLToPath(new URL('../node_modules/wrangler/bin/wrangler.js', import.meta.url)); const wranglerPath = fileURLToPath(
new URL('../node_modules/wrangler/bin/wrangler.js', import.meta.url)
);
export function runCLI(basePath, { silent }) { export function runCLI(basePath, { silent }) {
const script = fileURLToPath(new URL(`${basePath}/dist/_worker.js`, import.meta.url)); const script = fileURLToPath(new URL(`${basePath}/dist/_worker.js`, import.meta.url));
@ -23,23 +25,26 @@ export function runCLI(basePath, { silent }) {
const timeout = 10000; const timeout = 10000;
const ready = new Promise(async (resolve, reject) => { const ready = new Promise(async (resolve, reject) => {
const failed = setTimeout(() => reject(new Error(`Timed out starting the wrangler CLI`)), timeout); const failed = setTimeout(
() => reject(new Error(`Timed out starting the wrangler CLI`)),
timeout
);
(async function () { (async function () {
for(const msg of p.stderr) { for (const msg of p.stderr) {
if(!silent) { if (!silent) {
// eslint-disable-next-line // eslint-disable-next-line
console.error(msg); console.error(msg);
} }
} }
})(); })();
for await(const msg of p.stdout) { for await (const msg of p.stdout) {
if(!silent) { if (!silent) {
// eslint-disable-next-line // eslint-disable-next-line
console.log(msg); console.log(msg);
} }
if(msg.includes(`Listening on`)) { if (msg.includes(`Listening on`)) {
break; break;
} }
} }
@ -52,11 +57,11 @@ export function runCLI(basePath, { silent }) {
ready, ready,
stop() { stop() {
p.kill(); p.kill();
return new Promise(resolve => { return new Promise((resolve) => {
p.addListener('exit', () => { p.addListener('exit', () => {
resolve(); resolve();
}); });
}) });
} },
} };
} }