58 lines
1.4 KiB
JavaScript
Executable File
58 lines
1.4 KiB
JavaScript
Executable File
import Sync from '../src/sync.js'
|
|
import to from 'await-to-js'
|
|
import { expect } from 'chai'
|
|
import { it, describe } from 'mocha'
|
|
|
|
before(async () => {
|
|
console.log('in before')
|
|
const opts = {
|
|
configDir:'./test/files',
|
|
configName:'sync_config'
|
|
}
|
|
let sync = new Sync(opts)
|
|
|
|
console.log(sync.getConfig)
|
|
|
|
// await sync.loadJob('remote')
|
|
// console.log('command to be run',sync.command())
|
|
// sync.live()
|
|
// sync.execute({cli:true})
|
|
|
|
// await sync.configure('./test/config/sync')
|
|
// log.info({cmd:sync.command(), msg:'Rsync Command that will Run'})
|
|
// log.info(`making connection to ${remote.opts.host}`)
|
|
// log.info('ready for testing')
|
|
})
|
|
|
|
describe('Sync Class Testing ',async ()=> {
|
|
|
|
// let log = logger({})
|
|
// 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('test')
|
|
})
|
|
|
|
})
|
|
|
|
// function hooks(remote) {
|
|
//
|
|
|
|
// // beforeEach(async() => {
|
|
// // await someasyncfunctiontodobeforeeachtest()
|
|
// // })
|
|
//
|
|
// // after(async() => {
|
|
// // await someasyncfunctiontodoaftereeachtest()
|
|
// // })
|
|
//
|
|
// }
|