karma-env
v0.1.0
Published
Karma plugin for providing configuration like superstatic/Divshot
Downloads
8
Maintainers
Readme
karma-env
Karma plugin for providing configuration as window.__env
, mirroring superstatic/Divshot (docs).
// karma.conf.js
module.exports = function (config) {
config.set({
frameworks: ['env'],
files: [
'*.js'
],
client: {
env: {
KEY: 'VAL'
}
}
});
};
// 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.