Initial Version of sitemap.xml spec
This commit is contained in:
21
test-globals.mjs
Normal file
21
test-globals.mjs
Normal file
@@ -0,0 +1,21 @@
|
||||
// Test that globals are set up correctly by server.js
|
||||
// NOTE: Don't import server.js directly as it starts the server
|
||||
// Instead, we'll verify proxy.js works with the expected globals
|
||||
|
||||
// Set up globals like server.js does
|
||||
import crypto from 'node:crypto';
|
||||
globalThis.crypto = crypto;
|
||||
globalThis.config = { google: {}, server: {}, sitemap: {} }; // Mock config
|
||||
|
||||
// Now import proxy to verify it uses crypto global
|
||||
import { generateRequestId } from './src/proxy.js';
|
||||
|
||||
const reqId = generateRequestId();
|
||||
console.log('Generated request ID:', reqId);
|
||||
|
||||
if (reqId && reqId.startsWith('req_')) {
|
||||
console.log('✅ proxy.js can use global crypto successfully!');
|
||||
} else {
|
||||
console.log('❌ Failed to generate request ID');
|
||||
process.exit(1);
|
||||
}
|
||||
Reference in New Issue
Block a user