mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-05-02 01:34:56 +00:00
scripts: is,dbal,valid (3 files)
This commit is contained in:
14
dbal/ts/tests/core/validation/is-plain-object.test.ts
Normal file
14
dbal/ts/tests/core/validation/is-plain-object.test.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { isPlainObject } from '../../../src/core/validation/is-plain-object'
|
||||
|
||||
describe('isPlainObject', () => {
|
||||
it.each([
|
||||
{ value: {}, expected: true, description: 'empty object' },
|
||||
{ value: { key: 'value' }, expected: true, description: 'object with keys' },
|
||||
{ value: [], expected: false, description: 'array' },
|
||||
{ value: null, expected: false, description: 'null' },
|
||||
{ value: 'string', expected: false, description: 'string' },
|
||||
])('returns $expected for $description', ({ value, expected }) => {
|
||||
expect(isPlainObject(value)).toBe(expected)
|
||||
})
|
||||
})
|
||||
13
dbal/ts/tests/core/validation/is-valid-uuid.test.ts
Normal file
13
dbal/ts/tests/core/validation/is-valid-uuid.test.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { isValidUuid } from '../../../src/core/validation/is-valid-uuid'
|
||||
|
||||
describe('isValidUuid', () => {
|
||||
it.each([
|
||||
{ id: '550e8400-e29b-41d4-a716-446655440000', expected: true },
|
||||
{ id: '00000000-0000-0000-0000-000000000000', expected: true },
|
||||
{ id: 'not-a-uuid', expected: false },
|
||||
{ id: '550e8400e29b41d4a716446655440000', expected: false },
|
||||
])('returns $expected for $id', ({ id, expected }) => {
|
||||
expect(isValidUuid(id)).toBe(expected)
|
||||
})
|
||||
})
|
||||
0
tools/autobot.sh
Normal file → Executable file
0
tools/autobot.sh
Normal file → Executable file
Reference in New Issue
Block a user