49 lines
1.3 KiB
JavaScript
49 lines
1.3 KiB
JavaScript
import Sync from '../src/sync'
|
|
import to from 'await-to-js'
|
|
import { expect } from 'chai'
|
|
import { it } from 'mocha'
|
|
import logger from '@uci/logger'
|
|
// pause = require('@uci/utils').pPause
|
|
|
|
describe('Sync Class Testing ',async ()=> {
|
|
|
|
let sync
|
|
let log
|
|
before(async () => {
|
|
log = logger({ name: 'remote-code', test:'/test/sync.test.js', class:'sync',file:'src/sync.js', id: 'testing' })
|
|
sync = new Sync()
|
|
await sync.configure('./test/repo/config')
|
|
log.info({cmd:sync.command(), msg:'Rsync Command that will Run'})
|
|
// log.info(`making connection to ${remote.opts.host}`)
|
|
// log.info('ready for testing')
|
|
})
|
|
|
|
// after(async () => {
|
|
// remote.close()
|
|
// })
|
|
|
|
it('can sync a directory' , async function () {
|
|
// let [err,res] = await to(remote.exec('cd /opt && pwd'))
|
|
// if (err) {
|
|
// log.info('error running command aborting test', err)
|
|
// return
|
|
// }
|
|
// log.info(`result of remote command ${res.command} => ${res.reply.toString().trim()}`)
|
|
expect('test', 'test failed').to.equal('/opt')
|
|
})
|
|
|
|
})
|
|
|
|
// function hooks(remote) {
|
|
//
|
|
|
|
// // beforeEach(async() => {
|
|
// // await someasyncfunctiontodobeforeeachtest()
|
|
// // })
|
|
//
|
|
// // after(async() => {
|
|
// // await someasyncfunctiontodoaftereeachtest()
|
|
// // })
|
|
//
|
|
// }
|