import path from 'path' import rimraf from 'rimraf' import fs from 'fs' import { tsc } from '../src/commands/tsc' describe('output files', () => { it('nested', async (done) => { const cwd = path.resolve(__dirname, './fixtures/files/nested') await tsc({ cwd }) const filePath1 = path.resolve(cwd, './a/foo.js') const filePath2 = path.resolve(cwd, './a/a-b/bar.js') const filePath3 = path.resolve(cwd, './b/baz.js') ;[filePath1, filePath2, filePath3].forEach((p) => { expect(fs.readFileSync(p, 'utf-8')).toMatchSnapshot() }) rimraf(path.resolve(cwd, './**/*.js'), () => { done() }) }) })