Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions example-apps/tip-splitter/app/audit_verify.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import assert from 'node:assert';

console.log('Running automated manual verification for tip-splitter...');
// Validate Node environment built-ins
assert.strictEqual(typeof fetch, 'function', 'Global fetch built-in should exist');
assert.strictEqual(typeof crypto.randomUUID, 'function', 'crypto.randomUUID built-in should exist');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Accessing crypto.randomUUID directly will throw a ReferenceError: crypto is not defined in Node.js environments where crypto is not globally bound (such as Node.js versions prior to 19). To safely check for the existence of the global crypto.randomUUID built-in without throwing a ReferenceError, use optional chaining on globalThis.crypto.

Suggested change
assert.strictEqual(typeof crypto.randomUUID, 'function', 'crypto.randomUUID built-in should exist');
assert.strictEqual(typeof globalThis.crypto?.randomUUID, 'function', 'crypto.randomUUID built-in should exist');

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Node versions < 20 are no longer supported


console.log('Automated manual verification checks passed successfully!');
Loading