Changeset View
Changeset View
Standalone View
Standalone View
js_modules/dagit/jest/mocks/dagre_layout.worker.ts
import { layoutPipeline, IPipelineLayoutParams } from "../../src/graph/layout"; | // eslint-disable-next-line no-restricted-imports | ||||
import {layoutPipeline, IPipelineLayoutParams} from '../../src/graph/layout'; | |||||
// eslint-disable-next-line import/no-default-export | |||||
export default class MockWorker { | export default class MockWorker { | ||||
onmessage = (_: any) => {}; | onmessage = (_: any) => {}; | ||||
// mock expects data: { } instead of e: { data: { } } | // mock expects data: { } instead of e: { data: { } } | ||||
postMessage(data: IPipelineLayoutParams) { | postMessage(data: IPipelineLayoutParams) { | ||||
this.onmessage({ data: layoutPipeline(data) }); | this.onmessage({data: layoutPipeline(data.solids)}); | ||||
} | } | ||||
} | } |