mirror of
https://github.com/desktop/desktop
synced 2024-09-19 08:02:22 +00:00
Do a test
This commit is contained in:
parent
a12a9e77b9
commit
0563cbfd14
|
@ -23,10 +23,12 @@
|
|||
"react-dom": "^15.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"fs-extra": "^0.30.0",
|
||||
"react-addons-perf": "^15.2.1",
|
||||
"react-addons-test-utils": "^15.2.1",
|
||||
"react-transform-hmr": "^1.0.4",
|
||||
"style-loader": "^0.13.1",
|
||||
"temp": "^0.8.3",
|
||||
"webpack-hot-middleware": "^2.10.0"
|
||||
}
|
||||
}
|
||||
|
|
48
app/test/local-git-operations-test.ts
Normal file
48
app/test/local-git-operations-test.ts
Normal file
|
@ -0,0 +1,48 @@
|
|||
import * as chai from 'chai'
|
||||
const expect = chai.expect
|
||||
|
||||
import * as path from 'path'
|
||||
|
||||
const fs = require('fs-extra')
|
||||
const temp = require('temp').track()
|
||||
|
||||
import Repository from '../src/models/repository'
|
||||
import { LocalGitOperations } from '../src/lib/local-git-operations'
|
||||
|
||||
describe('LocalGitOperations', () => {
|
||||
let repository: Repository | null = null
|
||||
|
||||
beforeEach(() => {
|
||||
const testRepoName = 'test-repo'
|
||||
const testRepoFixturePath = path.join(__dirname, 'fixtures', testRepoName)
|
||||
const testRepoPath = temp.mkdirSync('desktop-git-test-')
|
||||
fs.copySync(testRepoFixturePath, testRepoPath)
|
||||
|
||||
fs.renameSync(path.join(testRepoPath, '_git'), path.join(testRepoPath, '.git'))
|
||||
|
||||
repository = new Repository(testRepoPath, null, null)
|
||||
})
|
||||
|
||||
describe('status', () => {
|
||||
it('parses changed files', async () => {
|
||||
fs.writeFileSync(path.join(repository!.path, 'README.md'), 'Hi world\n')
|
||||
|
||||
const status = await LocalGitOperations.getStatus(repository!)
|
||||
expect(status.workingDirectory.files.length).to.equal(1)
|
||||
})
|
||||
})
|
||||
|
||||
describe('committing', () => {
|
||||
|
||||
})
|
||||
|
||||
describe('history', () => {
|
||||
describe('changed files', () => {
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
describe('config', () => {
|
||||
|
||||
})
|
||||
})
|
Loading…
Reference in a new issue