mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-01 05:02:43 +03:00
22 lines
769 B
TypeScript
22 lines
769 B
TypeScript
|
import { expect, test } from 'vitest';
|
||
|
|
||
|
test('compare config', async () => {
|
||
|
const { default: nextConfigMock } = await import(
|
||
|
'../../scripts/vitest/next-config-mock'
|
||
|
);
|
||
|
const mockConfig = nextConfigMock().publicRuntimeConfig;
|
||
|
const { default: nextConfig } = await import(
|
||
|
'../../apps/web/next.config.mjs'
|
||
|
);
|
||
|
const config = nextConfig.publicRuntimeConfig;
|
||
|
|
||
|
Object.keys(config).forEach(key => {
|
||
|
expect(key in mockConfig, `${key} should be in the mockConfig`).toBe(true);
|
||
|
expect(typeof config[key], `${key}`).toBe(typeof mockConfig[key]);
|
||
|
});
|
||
|
Object.keys(mockConfig).forEach(key => {
|
||
|
expect(key in config, `${key} should be in the config`).toBe(true);
|
||
|
expect(typeof config[key], `${key}`).toBe(typeof mockConfig[key]);
|
||
|
});
|
||
|
});
|