diff --git a/src/utils/__test__/clone.spec.ts b/src/utils/__test__/clone.spec.ts new file mode 100644 index 0000000..d1ff30e --- /dev/null +++ b/src/utils/__test__/clone.spec.ts @@ -0,0 +1,28 @@ +import exists from '../exists'; +import clone from '../clone' +import { rm } from 'shelljs' +import { join } from 'path'; + + +describe('utils/clone', () => { + const destination = join(__dirname, 'output', 'clone', 'example') + const options = { + temp: join(__dirname, 'output', 'clone', '.gitcopy'), + } + + beforeEach(async () => { + rm('-rf', join(__dirname, 'output', 'clone', '.gitcopy')) + }) + afterEach(async () => { + rm('-rf', destination) + }) + + afterAll(async () => { + rm('-rf', join(__dirname, 'output', 'clone', '.gitcopy')) + }) + it('should clone the repository', async () => { + const result = await clone('lukeed/gittar', options) + console.log(result) + expect(await exists(result)).toBe(true) + }) +}) \ No newline at end of file