fix(core): update
This commit is contained in:
parent
a1aa1543a2
commit
b54a5e2fef
4
test/assets/env.json
Normal file
4
test/assets/env.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"key1": "fromJson",
|
||||||
|
"key2" :"fromJson"
|
||||||
|
}
|
@ -1,2 +0,0 @@
|
|||||||
key1: fromYml
|
|
||||||
key2: fromYml
|
|
@ -17,13 +17,13 @@ tap.test('key1 should be not be overwritten since it is already present', async
|
|||||||
});
|
});
|
||||||
|
|
||||||
tap.test('key2 should be read from Yml', async () => {
|
tap.test('key2 should be read from Yml', async () => {
|
||||||
expect(testQenv.getEnvVarRequired('key2')).to.equal('fromYml');
|
expect(testQenv.getEnvVarRequired('key2')).to.equal('fromJson');
|
||||||
expect(testQenv.getEnvVarOnDemand('key2')).to.equal('fromYml');
|
expect(testQenv.getEnvVarOnDemand('key2')).to.equal('fromJson');
|
||||||
});
|
});
|
||||||
|
|
||||||
tap.test('keyValueObjectArray should hold all retrieved values', async () => {
|
tap.test('keyValueObjectArray should hold all retrieved values', async () => {
|
||||||
expect(testQenv.keyValueObject.key1).to.equal('original');
|
expect(testQenv.keyValueObject.key1).to.equal('original');
|
||||||
expect(testQenv.keyValueObject.key2).to.equal('fromYml');
|
expect(testQenv.keyValueObject.key2).to.equal('fromJson');
|
||||||
});
|
});
|
||||||
|
|
||||||
tap.start();
|
tap.start();
|
||||||
|
@ -31,7 +31,7 @@ export class Qenv {
|
|||||||
);
|
);
|
||||||
this.envFilePathAbsolute = plugins.path.join(
|
this.envFilePathAbsolute = plugins.path.join(
|
||||||
plugins.path.resolve(envFileBasePathArg),
|
plugins.path.resolve(envFileBasePathArg),
|
||||||
'env.yml'
|
'env.json'
|
||||||
);
|
);
|
||||||
|
|
||||||
this.getRequiredEnvVars();
|
this.getRequiredEnvVars();
|
||||||
@ -131,7 +131,7 @@ export class Qenv {
|
|||||||
this.logger.log('ok', `found ${requiredEnvVar} as environment variable`);
|
this.logger.log('ok', `found ${requiredEnvVar} as environment variable`);
|
||||||
chosenVar = envVar;
|
chosenVar = envVar;
|
||||||
} else if (envFileVar) {
|
} else if (envFileVar) {
|
||||||
this.logger.log('ok', `found ${requiredEnvVar} as env.yml variable`);
|
this.logger.log('ok', `found ${requiredEnvVar} as env.json variable`);
|
||||||
chosenVar = envFileVar;
|
chosenVar = envFileVar;
|
||||||
} else if (dockerSecret) {
|
} else if (dockerSecret) {
|
||||||
this.logger.log('ok', `found ${requiredEnvVar} as docker secret`);
|
this.logger.log('ok', `found ${requiredEnvVar} as docker secret`);
|
||||||
|
Loading…
Reference in New Issue
Block a user