2022-08-01 20:06:14 +10:00
|
|
|
import { file } from '../src/index.js';
|
2022-08-02 12:14:58 +10:00
|
|
|
import type { Models } from '../src/index.js';
|
2022-08-01 14:27:11 +10:00
|
|
|
import fsp from 'fs/promises';
|
|
|
|
|
|
|
|
describe('Testing create_file_execution', () => {
|
|
|
|
it("shouldn't throw", async () => {
|
|
|
|
const { stderr, stdout, output_files } = (await file.create_file_execution({
|
|
|
|
lang: 'go',
|
|
|
|
output: 'output.stl',
|
|
|
|
body: await fsp.readFile('./exampleGoScript.go', 'base64'),
|
2022-08-02 12:14:58 +10:00
|
|
|
})) as Models['CodeOutput_type'];
|
2022-08-01 14:27:11 +10:00
|
|
|
expect(stderr).toBe('');
|
|
|
|
expect(stdout).toBe(
|
|
|
|
[
|
|
|
|
'File conversion id: bdbf2969-8015-448b-a237-841d421fd1fe',
|
|
|
|
'File conversion status: Completed',
|
|
|
|
'Saving output to ./output.stl\n',
|
|
|
|
].join('\n'),
|
|
|
|
);
|
|
|
|
expect(output_files[0].contents).toHaveLength(191308);
|
|
|
|
|
|
|
|
expect(true).toBe(true);
|
|
|
|
});
|
|
|
|
});
|