All checks were successful
Validation Dashboard / Tests backend et build frontend (push) Successful in 58s
28 lines
1.2 KiB
JavaScript
28 lines
1.2 KiB
JavaScript
import assert from 'node:assert/strict';
|
|
import test from 'node:test';
|
|
|
|
import { getEnvironmentConfig } from '../src/utils/environment.js';
|
|
|
|
test('détecte le dashboard de recette depuis son domaine public', () => {
|
|
const config = getEnvironmentConfig('dashboard-santinova.recette.santinova-soft.org');
|
|
assert.equal(config.isRecette, true);
|
|
assert.equal(config.label, 'Recette');
|
|
assert.equal(config.serverPublicIp, '78.138.58.109');
|
|
assert.equal(config.giteaUrl, 'https://git.recette.santinova-soft.org');
|
|
assert.equal(config.appDomainSuffix, 'recette.santinova-soft.org');
|
|
});
|
|
|
|
test('détecte le dashboard de production depuis son domaine public', () => {
|
|
const config = getEnvironmentConfig('dashboard-santinova.santinova-soft.org');
|
|
assert.equal(config.isRecette, false);
|
|
assert.equal(config.label, 'Production');
|
|
assert.equal(config.serverPublicIp, '180.149.196.138');
|
|
assert.equal(config.giteaUrl, 'https://git.santinova-soft.org');
|
|
assert.equal(config.appDomainSuffix, 'santinova-soft.org');
|
|
});
|
|
|
|
test('utilise la recette pour le développement local', () => {
|
|
assert.equal(getEnvironmentConfig('localhost').isRecette, true);
|
|
assert.equal(getEnvironmentConfig('127.0.0.1').isRecette, true);
|
|
});
|