1
0
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:
Fredrik Oseberg 2023-12-07 12:17:08 +01:00
parent c87d356b77
commit e448cfe58d
No known key found for this signature in database
GPG Key ID: 816A423246CADD4E
3 changed files with 0 additions and 30 deletions

View File

@ -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);
};

View File

@ -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);
});
});

View File

@ -87,12 +87,6 @@ export default async function init(
getLogger: LogProvider = noLoggerProvider,
configOverride: Partial<IUnleashOptions> = {},
): Promise<ITestDb> {
if (isNotSnakeCase(databaseSchema)) {
throw new Error(
`db init database schema must be snake case, was: ${databaseSchema}`,
);
}
const config = createTestConfig({
db: {
...getDbConfig(),