(run)
| 14 | } = require('../core/sandbox/providers'); |
| 15 | |
| 16 | async function withTempProject(run) { |
| 17 | const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'citadel-sandbox-')); |
| 18 | try { |
| 19 | await run(dir); |
| 20 | } finally { |
| 21 | fs.rmSync(dir, { recursive: true, force: true }); |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | withTempProject(async (projectRoot) => { |
| 26 | fs.writeFileSync(path.join(projectRoot, 'package.json'), JSON.stringify({ scripts: { test: 'node test.js' } }), 'utf8'); |
no test coverage detected