Skip to content

Commit

Permalink
[ci] format
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewp authored and astrobot-houston committed Jul 27, 2022
1 parent fd3dfba commit 7f34c60
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
4 changes: 2 additions & 2 deletions packages/integrations/cloudflare/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ export default function createIntegration(): AstroIntegration {
bundle: true,
minify: true,
banner: {
js: SHIM
}
js: SHIM,
},
});

// throw the server folder in the bin
Expand Down
1 change: 0 additions & 1 deletion packages/integrations/cloudflare/test/basics.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,3 @@ describe('Basic app', () => {
}
});
});

27 changes: 16 additions & 11 deletions packages/integrations/cloudflare/test/test-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ export function loadFixture(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 }) {
const script = fileURLToPath(new URL(`${basePath}/dist/_worker.js`, import.meta.url));
Expand All @@ -23,23 +25,26 @@ export function runCLI(basePath, { silent }) {
const timeout = 10000;

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 () {
for(const msg of p.stderr) {
if(!silent) {
for (const msg of p.stderr) {
if (!silent) {
// eslint-disable-next-line
console.error(msg);
}
}
})();

for await(const msg of p.stdout) {
if(!silent) {
for await (const msg of p.stdout) {
if (!silent) {
// eslint-disable-next-line
console.log(msg);
}
if(msg.includes(`Listening on`)) {
if (msg.includes(`Listening on`)) {
break;
}
}
Expand All @@ -52,11 +57,11 @@ export function runCLI(basePath, { silent }) {
ready,
stop() {
p.kill();
return new Promise(resolve => {
return new Promise((resolve) => {
p.addListener('exit', () => {
resolve();
});
})
}
}
});
},
};
}

0 comments on commit 7f34c60

Please sign in to comment.