karma-env
Karma plugin for providing configuration as window.__env
, mirroring superstatic/Divshot (docs).
// karma.conf.jsmodule { config;};
// test.js
console.log(window.__env.KEY) // => 'VAL'
You can pass in whatever environment configuration you'd like, including process.env
or require('./.env.json')
. If no environment is provided, window.__env
will be an empty object.