Files
cell/tests/test_actor_access.js
John Alanbrook efd98460c5
Some checks failed
Build and Deploy / build-macos (push) Failing after 4s
Build and Deploy / build-windows (CLANG64) (push) Has been cancelled
Build and Deploy / package-dist (push) Has been cancelled
Build and Deploy / deploy-itch (push) Has been cancelled
Build and Deploy / deploy-gitea (push) Has been cancelled
Build and Deploy / build-linux (push) Has been cancelled
-u is no longer available as a global, only within the running actor code; enable passing args to use
2025-05-22 18:59:57 -05:00

18 lines
594 B
JavaScript

// Test that actors have access to $_
console.log("Testing actor access to $_:");
// In an actor script, $_ should be available
if (typeof $_ !== 'undefined') {
console.log("✓ Actor has access to $_");
console.log(" $_.random is a", typeof $_.random);
console.log(" $_.clock is a", typeof $_.clock);
// Test spawning another actor
var child = this.spawn('test_child_actor.js');
// Test using a module
var testModule = use('test_module');
console.log("✓ Module loaded, result:", testModule.test());
} else {
console.error("✗ Actor does NOT have access to $_");
}