2023-06-01 10:07:07 +10:00
|
|
|
import fsp from 'fs/promises';
|
|
|
|
import { executor } from '../../src/index.js';
|
|
|
|
|
|
|
|
async function example() {
|
|
|
|
const response = await executor.create_file_execution({
|
|
|
|
lang: 'go',
|
|
|
|
output: 'string',
|
2024-10-11 12:45:04 -04:00
|
|
|
body: await fsp.readFile('./example.go', 'base64'),
|
2023-06-01 10:07:07 +10:00
|
|
|
});
|
|
|
|
if ('error_code' in response) throw response;
|
|
|
|
|
|
|
|
return response;
|
|
|
|
}
|
|
|
|
|
|
|
|
describe('Testing executor.create_file_execution', () => {
|
|
|
|
it('should be truthy or throw', async () => {
|
|
|
|
expect(await example()).toBeTruthy();
|
|
|
|
});
|
|
|
|
});
|