aboutsummaryrefslogtreecommitdiff
path: root/packages/integrations/cloudflare/test/dev-runtime-workers.test.js
diff options
context:
space:
mode:
Diffstat (limited to 'packages/integrations/cloudflare/test/dev-runtime-workers.test.js')
-rw-r--r--packages/integrations/cloudflare/test/dev-runtime-workers.test.js91
1 files changed, 0 insertions, 91 deletions
diff --git a/packages/integrations/cloudflare/test/dev-runtime-workers.test.js b/packages/integrations/cloudflare/test/dev-runtime-workers.test.js
deleted file mode 100644
index a2f8d3847..000000000
--- a/packages/integrations/cloudflare/test/dev-runtime-workers.test.js
+++ /dev/null
@@ -1,91 +0,0 @@
-import * as assert from 'node:assert/strict';
-import { after, before, describe, it } from 'node:test';
-import { fileURLToPath } from 'node:url';
-import * as cheerio from 'cheerio';
-import { astroCli } from './_test-utils.js';
-
-const root = new URL('./fixtures/dev-runtime-workers/', import.meta.url);
-describe('DevRuntimeWorkers', () => {
- let cli;
- before(async () => {
- cli = astroCli(fileURLToPath(root), 'dev', '--host', '127.0.0.1');
- await new Promise((resolve) => {
- cli.stdout.on('data', (data) => {
- if (data.includes('http://127.0.0.1:4321/')) {
- resolve();
- }
- });
- });
- });
-
- after((done) => {
- cli.kill();
- setTimeout(() => {
- // console.log('CLEANED');
- done();
- }, 1000);
- });
-
- it('exists', async () => {
- const res = await fetch('http://127.0.0.1:4321/');
- const html = await res.text();
- const $ = cheerio.load(html);
- assert.equal($('#hasRuntime').text().includes('true'), true);
- });
-
- it('adds cf object', async () => {
- const res = await fetch('http://127.0.0.1:4321/');
- const html = await res.text();
- const $ = cheerio.load(html);
- assert.equal($('#hasCF').text(), 'true');
- });
-
- it('adds cache mocking', async () => {
- const res = await fetch('http://127.0.0.1:4321/caches');
- const html = await res.text();
- const $ = cheerio.load(html);
- assert.equal($('#hasCACHE').text(), 'true');
- });
-
- it('adds D1 mocking', async () => {
- const res = await fetch('http://127.0.0.1:4321/d1');
- const html = await res.text();
- const $ = cheerio.load(html);
- assert.equal($('#hasDB').text(), 'true');
- assert.equal($('#hasPRODDB').text(), 'true');
- assert.equal($('#hasACCESS').text(), 'true');
- });
-
- it('adds R2 mocking', async () => {
- const res = await fetch('http://127.0.0.1:4321/r2');
- const html = await res.text();
- const $ = cheerio.load(html);
- assert.equal($('#hasBUCKET').text(), 'true');
- assert.equal($('#hasPRODBUCKET').text(), 'true');
- assert.equal($('#hasACCESS').text(), 'true');
- });
-
- it('adds KV mocking', async () => {
- const res = await fetch('http://127.0.0.1:4321/kv');
- const html = await res.text();
- const $ = cheerio.load(html);
- assert.equal($('#hasKV').text(), 'true');
- assert.equal($('#hasPRODKV').text(), 'true');
- assert.equal($('#hasACCESS').text(), 'true');
- });
-
- it('adds DO mocking', async () => {
- const res = await fetch('http://127.0.0.1:4321/do');
- const html = await res.text();
- const $ = cheerio.load(html);
- assert.equal($('#hasDO').text(), 'true');
- });
-
- it('adds service bindings mocking', async () => {
- const res = await fetch('http://127.0.0.1:4321/services');
- const html = await res.text();
- const $ = cheerio.load(html);
- assert.equal($('#hasAUTH').text(), 'true');
- assert.equal($('#hasLOGOUT').text(), 'true');
- });
-});