mirror of
https://github.com/Unleash/unleash.git
synced 2025-09-15 17:50:48 +02:00
fix: rm schema validation
This commit is contained in:
parent
c87d356b77
commit
e448cfe58d
@ -1,8 +0,0 @@
|
|||||||
const isSnakeCase = (input: string) => {
|
|
||||||
const snakeCaseRegex = /^[a-z]+(_[a-z]+)*$/;
|
|
||||||
return snakeCaseRegex.test(input);
|
|
||||||
};
|
|
||||||
|
|
||||||
export const isNotSnakeCase = (input: string) => {
|
|
||||||
return !isSnakeCase(input);
|
|
||||||
};
|
|
@ -1,16 +0,0 @@
|
|||||||
import { isNotSnakeCase } from './database-init-helpers';
|
|
||||||
|
|
||||||
describe('isNotSnakeCase', () => {
|
|
||||||
it('should return true for non-snake case strings', () => {
|
|
||||||
expect(isNotSnakeCase('HelloWorld')).toBe(true);
|
|
||||||
expect(isNotSnakeCase('helloWorld')).toBe(true);
|
|
||||||
expect(isNotSnakeCase('hello-world')).toBe(true);
|
|
||||||
expect(isNotSnakeCase('hello world')).toBe(true);
|
|
||||||
expect(isNotSnakeCase('HELLO_WORLD')).toBe(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should return false for snake case strings', () => {
|
|
||||||
expect(isNotSnakeCase('hello_world')).toBe(false);
|
|
||||||
expect(isNotSnakeCase('hello')).toBe(false);
|
|
||||||
});
|
|
||||||
});
|
|
@ -87,12 +87,6 @@ export default async function init(
|
|||||||
getLogger: LogProvider = noLoggerProvider,
|
getLogger: LogProvider = noLoggerProvider,
|
||||||
configOverride: Partial<IUnleashOptions> = {},
|
configOverride: Partial<IUnleashOptions> = {},
|
||||||
): Promise<ITestDb> {
|
): Promise<ITestDb> {
|
||||||
if (isNotSnakeCase(databaseSchema)) {
|
|
||||||
throw new Error(
|
|
||||||
`db init database schema must be snake case, was: ${databaseSchema}`,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const config = createTestConfig({
|
const config = createTestConfig({
|
||||||
db: {
|
db: {
|
||||||
...getDbConfig(),
|
...getDbConfig(),
|
||||||
|
Loading…
Reference in New Issue
Block a user