mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
refactor: test directory structure (#1677)
This commit is contained in:
21
tests/unit/compare-config.spec.ts
Normal file
21
tests/unit/compare-config.spec.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
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]);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user