Skip to content

Commit

Permalink
Added basic tests for clone
Browse files Browse the repository at this point in the history
  • Loading branch information
Takeshi committed Feb 16, 2024
1 parent 1f38bfe commit 656d279
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/utils/__test__/clone.spec.ts
Original file line number Diff line number Diff line change
@@ -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)
})
})

0 comments on commit 656d279

Please sign in to comment.