Files
windmill/frontend/src/lib/components/graph/wacToFlow.test.ts
T
centdix 0d0557fc9d feat: add wac ai context for frontend chat (#9021)
* feat: add wac ai context

* fix: limit wac context languages

* fix: pass wac auto kind in flow script drawer
2026-05-05 15:00:06 +00:00

20 lines
631 B
TypeScript

import { describe, expect, it } from 'vitest'
import { isWorkflowAsCode } from './wacToFlow'
const tsWac = `
import { workflow, task } from "windmill-client"
const process = task(async () => "ok")
export const main = workflow(async () => await process())
`
describe('isWorkflowAsCode', () => {
it('detects WAC only for Bun TypeScript and Python', () => {
expect(isWorkflowAsCode(tsWac, 'bun')).toBe(true)
expect(isWorkflowAsCode(tsWac, 'deno')).toBe(false)
expect(isWorkflowAsCode(tsWac, 'nativets')).toBe(false)
expect(isWorkflowAsCode('@workflow\nasync def main():\n return None\n', 'python3')).toBe(true)
})
})