How to test if running on CF worker platform


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

  1. Test javascript locally on nodejs, then
  2. Test locally on dollarshave/cloudworkers, then promote to
  3. 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.