(content: string, prefix = 'deepnote-test-')
| 9 | * Returns the absolute path to the created file. |
| 10 | */ |
| 11 | export async function createTempFile(content: string, prefix = 'deepnote-test-'): Promise<string> { |
| 12 | const tempDir = await fs.mkdtemp(join(os.tmpdir(), prefix)) |
| 13 | const filePath = join(tempDir, 'test.deepnote') |
| 14 | await fs.writeFile(filePath, content, 'utf8') |
| 15 | return filePath |
| 16 | } |
| 17 | |
| 18 | /** |
| 19 | * Clean up a temporary file and its parent directory. |
no outgoing calls
no test coverage detected