Skip to content

Commit

Permalink
Merge branch 'main' into fix/shell
Browse files Browse the repository at this point in the history
  • Loading branch information
natemoo-re authored Aug 15, 2023
2 parents de4175c + a37b224 commit c55eaca
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
5 changes: 4 additions & 1 deletion packages/integrations/cloudflare/test/cf.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ describe('Cf metadata and caches', () => {
let html = await res.text();
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');
});
});
23 changes: 15 additions & 8 deletions packages/integrations/cloudflare/test/test-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,28 @@ export async function runCLI(basePath, { silent, port }) {
}

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.stdout.setEncoding('utf-8');

const timeout = 10_000;

const ready = new Promise(async (resolve, reject) => {
const failed = setTimeout(
() => {
p.kill();
reject(new Error(`Timed out starting the wrangler CLI`));
},
timeout
);
const failed = setTimeout(() => {
p.kill();
reject(new Error(`Timed out starting the wrangler CLI`));
}, timeout);

(async function () {
for (const msg of p.stderr) {
Expand Down

0 comments on commit c55eaca

Please sign in to comment.