mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 03:01:54 +00:00
Reduce loglevel on node def validation (#295)
* Lower the loglevel of node def validation messages * Fix tests
This commit is contained in:
@@ -20,8 +20,8 @@ const EXAMPLE_NODE_DEF: ComfyNodeDef = {
|
||||
}
|
||||
|
||||
describe('validateNodeDef', () => {
|
||||
it('Should accept a valid node definition', () => {
|
||||
expect(() => validateComfyNodeDef(EXAMPLE_NODE_DEF)).not.toThrow()
|
||||
it('Should accept a valid node definition', async () => {
|
||||
expect(await validateComfyNodeDef(EXAMPLE_NODE_DEF)).not.toBeNull()
|
||||
})
|
||||
|
||||
describe.each([
|
||||
@@ -35,14 +35,16 @@ describe('validateNodeDef', () => {
|
||||
])(
|
||||
'validateComfyNodeDef with various input spec formats',
|
||||
(inputSpec, expected) => {
|
||||
it(`should accept input spec format: ${JSON.stringify(inputSpec)}`, () => {
|
||||
it(`should accept input spec format: ${JSON.stringify(inputSpec)}`, async () => {
|
||||
expect(
|
||||
validateComfyNodeDef({
|
||||
...EXAMPLE_NODE_DEF,
|
||||
input: {
|
||||
required: inputSpec
|
||||
}
|
||||
}).input.required.ckpt_name
|
||||
(
|
||||
await validateComfyNodeDef({
|
||||
...EXAMPLE_NODE_DEF,
|
||||
input: {
|
||||
required: inputSpec
|
||||
}
|
||||
})
|
||||
).input.required.ckpt_name
|
||||
).toEqual(expected)
|
||||
})
|
||||
}
|
||||
@@ -57,15 +59,15 @@ describe('validateNodeDef', () => {
|
||||
])(
|
||||
'validateComfyNodeDef rejects with various input spec formats',
|
||||
(inputSpec) => {
|
||||
it(`should accept input spec format: ${JSON.stringify(inputSpec)}`, () => {
|
||||
expect(() =>
|
||||
validateComfyNodeDef({
|
||||
it(`should accept input spec format: ${JSON.stringify(inputSpec)}`, async () => {
|
||||
expect(
|
||||
await validateComfyNodeDef({
|
||||
...EXAMPLE_NODE_DEF,
|
||||
input: {
|
||||
required: inputSpec
|
||||
}
|
||||
})
|
||||
).toThrow()
|
||||
).toBeNull()
|
||||
})
|
||||
}
|
||||
)
|
||||
@@ -76,8 +78,9 @@ describe('validateNodeDef', () => {
|
||||
fs.readFileSync(path.resolve('./tests-ui/data/object_info.json'))
|
||||
)
|
||||
)
|
||||
nodeDefs.forEach((nodeDef) => {
|
||||
expect(() => validateComfyNodeDef(nodeDef)).not.toThrow()
|
||||
})
|
||||
|
||||
for (const nodeDef of nodeDefs) {
|
||||
expect(await validateComfyNodeDef(nodeDef)).not.toBeNull()
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user