Skip to content

Commit

Permalink
chore(cloudflare): minor test improvements (#223)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fryuni authored Apr 6, 2024
1 parent b153fc4 commit ddb2802
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/cloudflare/test/_test-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ export function astroCli(cwd, /** @type {string[]} */ ...args) {
const wranglerPath = fileURLToPath(
new URL('../node_modules/wrangler/bin/wrangler.js', import.meta.url)
);
/** Returns a process running the Astro CLI. */

/** Returns a process running the Wrangler CLI. */
export function wranglerCli(cwd) {
const spawned = execa(
wranglerPath,
Expand Down
8 changes: 6 additions & 2 deletions packages/cloudflare/test/no-output.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as assert from 'node:assert/strict';
import { before, describe, it } from 'node:test';
import { describe, it } from 'node:test';
import { fileURLToPath } from 'node:url';
import { astroCli } from './_test-utils.js';

Expand All @@ -14,6 +14,10 @@ describe('MissingOutputConfig', () => {
error = err;
}
assert.notEqual(error, undefined);
assert.equal(error.message.includes(`output: "server"`), true);
assert.ok(
error.message.includes(
'[@astrojs/cloudflare] `output: "server"` or `output: "hybrid"` is required to use this adapter.'
)
);
});
});

0 comments on commit ddb2802

Please sign in to comment.