UNPKG
dotenv-json
Version:
latest (1.0.0)
1.0.0
Load environment variables via a JSON file
github.com/maxbeatty/dotenv-json
maxbeatty/dotenv-json
dotenv-json
/
index.test.js
11 lines
(6 loc)
•
253 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
const
assert
=
require(
"assert"
);
const
dotenvJSON
=
require(
"./index"
);
assert
.ok(!process.env.hasOwnProperty(
"sample"
)); dotenvJSON();
// loads .env.json
assert
.ok(process.env.hasOwnProperty(
"sample"
));
assert
.equal(process.env.sample,
"value1"
);