mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-17 21:15:32 +09:00
chore(workspace): tighten quality gates (#2230)
This commit is contained in:
1 parent
e6e4c6f7b5
commit
5c2dca1c51
123 files changed
+4925
-5640
No files matched your search
@@ -7,7 +7,7 @@ import {
|
||||
extractKVClientConfig,
|
||||
extractRateLimit,
|
||||
} from '@fluxer/config/src/ServiceConfigSlices';
|
||||
import {describe, expect, test} from 'vitest';
|
||||
import {describe, expect, test, vi} from 'vitest';
|
||||
|
||||
function createMasterStub(overrides: Partial<MasterConfig> = {}): MasterConfig {
|
||||
return {
|
||||
@@ -55,12 +55,23 @@ describe('extractKVClientConfig', () => {
|
||||
});
|
||||
|
||||
describe('extractBuildInfoConfig', () => {
|
||||
test('returns releaseChannel and buildVersion', () => {
|
||||
const result = extractBuildInfoConfig();
|
||||
expect(result).toHaveProperty('releaseChannel');
|
||||
expect(result).toHaveProperty('buildVersion');
|
||||
expect(typeof result.releaseChannel).toBe('string');
|
||||
expect(typeof result.buildVersion).toBe('string');
|
||||
test('returns fallback build metadata and reports the missing environment variables', () => {
|
||||
vi.stubEnv('BUILD_VERSION', undefined);
|
||||
vi.stubEnv('RELEASE_CHANNEL', undefined);
|
||||
const stdout = vi.spyOn(process.stdout, 'write').mockImplementation(() => true);
|
||||
try {
|
||||
const result = extractBuildInfoConfig();
|
||||
expect(result).toEqual({
|
||||
releaseChannel: 'stable',
|
||||
buildVersion: 'dev',
|
||||
});
|
||||
expect(stdout).toHaveBeenCalledExactlyOnceWith(
|
||||
'[build-metadata] Using fallback values for: BUILD_VERSION, RELEASE_CHANNEL. This indicates missing env vars in CI/production.\n',
|
||||
);
|
||||
} finally {
|
||||
stdout.mockRestore();
|
||||
vi.unstubAllEnvs();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user