Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

583 B
Raw Blame
/// <reference types="vitest/globals" />

import { createFile } from '../src/lib/actions/create-file';
import { createMockActionContext } from '@activepieces/pieces-framework';

describe('createFile', () => {
  test('creates file with utf8 encoding', async () => {
    const ctx = createMockActionContext({
      propsValue: {
        content: 'Hello, World!',
        fileName: 'test.txt',
        encoding: 'utf8',
      },
    });
    const result = await createFile.run(ctx);
    expect(result).toEqual({
      fileName: 'test.txt',
      url: 'test-file-url',
    });
  });
});