26 lines
2.3 KiB
JavaScript
26 lines
2.3 KiB
JavaScript
"use strict";
|
|
require("typings-test");
|
|
const path = require("path");
|
|
require("should");
|
|
const index_1 = require("../dist/index");
|
|
process.cwd = () => {
|
|
return path.join(__dirname, "./assets/");
|
|
};
|
|
process.env["key1"] = "original";
|
|
let qenvTestObject;
|
|
describe("Qenv class", function () {
|
|
it("should create a new class", function () {
|
|
qenvTestObject = new index_1.Qenv(process.cwd(), process.cwd(), false);
|
|
});
|
|
it("key1 should be not be overwritten since it is already present", function () {
|
|
process.env.key1.should.equal("original");
|
|
});
|
|
it("key2 should be read from Yml", function () {
|
|
process.env.key2.should.equal("fromYml");
|
|
});
|
|
it("keyValueObjectArray should hold all retrieved values", function () {
|
|
qenvTestObject.keyValueObjectArray[0].value.should.equal("original");
|
|
qenvTestObject.keyValueObjectArray[1].value.should.equal("fromYml");
|
|
});
|
|
});
|
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sY0FBYyxDQUFDLENBQUE7QUFDdEIsTUFBWSxJQUFJLFdBQU0sTUFBTSxDQUFDLENBQUE7QUFDN0IsUUFBTyxRQUFRLENBQUMsQ0FBQTtBQUNoQix3QkFBbUIsZUFBZSxDQUFDLENBQUE7QUFFbkMsT0FBTyxDQUFDLEdBQUcsR0FBRztJQUNWLE1BQU0sQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLFNBQVMsRUFBQyxXQUFXLENBQUMsQ0FBQztBQUM1QyxDQUFDLENBQUE7QUFFRCxPQUFPLENBQUMsR0FBRyxDQUFDLE1BQU0sQ0FBQyxHQUFHLFVBQVUsQ0FBQTtBQUVoQyxJQUFJLGNBQW1CLENBQUM7QUFDeEIsUUFBUSxDQUFDLFlBQVksRUFBQztJQUNsQixFQUFF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