Personal Telegram developer console for GitHub
test: require isolated Cloudflare preview bindings
davoodmehraban89 committed
Oct 4, 2026 at 14:20 UTC
da3213f393481144c9bea8f655bdfda476378057
1 file changed
+14
test/ops-console.test.js
+14
@@ -1,5 +1,6 @@
1
import { describe, it } from 'node:test';
2
import assert from 'node:assert/strict';
3
+import { readFileSync } from 'node:fs';
4
import { RuntimeDiagnostics } from '../src/core/runtime-diagnostics.js';
5
import { OpsMenuManager } from '../src/ops-menu.js';
6
@@ -118,6 +119,19 @@ describe('Nexa Dev Bot - operational diagnostics', () => {
119
assert.equal(byId[id]?.ok, false, `${id} should fail closed`);
120
}
121
});
122
+
123
+ it('configures Cloudflare Worker Previews with isolated Durable Object bindings', () => {
124
+ const config = JSON.parse(readFileSync(new URL('../wrangler.jsonc', import.meta.url), 'utf8'));
125
+ const production = config.durable_objects?.bindings || [];
126
+ const preview = config.previews?.durable_objects?.bindings || [];
127
+ assert.ok(config.previews, 'wrangler previews block is required');
128
+ for (const binding of production) {
129
+ assert.ok(
130
+ preview.some(candidate => candidate.name === binding.name && candidate.class_name === binding.class_name),
131
+ `preview missing durable binding ${binding.name}`
132
+ );
133
+ }
134
+ });
135
});
136
137
describe('Nexa Dev Bot - operational menu surfaces', () => {