mirror of
https://github.com/wassname/optuna-dashboard.git
synced 2026-09-06 17:00:30 +08:00
35 lines
739 B
TypeScript
35 lines
739 B
TypeScript
import { mergeUnionSearchSpace } from "../optuna_dashboard/ts/searchSpace"
|
|
|
|
global.URL.createObjectURL = jest.fn()
|
|
|
|
it("Aggregate SearchSpaceItem", () => {
|
|
const aggregated = mergeUnionSearchSpace([
|
|
{
|
|
name: "float1",
|
|
distribution: {
|
|
type: "FloatDistribution",
|
|
low: 0,
|
|
high: 5,
|
|
step: 1,
|
|
log: true,
|
|
},
|
|
},
|
|
{
|
|
name: "float1",
|
|
distribution: {
|
|
type: "FloatDistribution",
|
|
low: 5,
|
|
high: 10,
|
|
step: 1,
|
|
log: true,
|
|
},
|
|
},
|
|
])
|
|
|
|
expect(aggregated.length).toBe(1)
|
|
// @ts-ignore
|
|
expect(aggregated[0].distribution.low as number).toBe(0)
|
|
// @ts-ignore
|
|
expect(aggregated[0].distribution.high as number).toBe(10)
|
|
})
|