Hi!
How does one determine if a script is running on CF worker infrastructure or nodejs?
Why do we need this? Testing.
We need to provide some environment values to our test scripts - these are provided to workers automatically through global env/KV in workers.
We currently
- Test javascript locally on nodejs, then
- Test locally on dollarshave/cloudworkers, then promote to
- Test using workers dev or/and workers tail as necessary.
Our hope is to minimize the number of variable ‘undefined’ tests in our code base.