test: migration from Python to JavaScript

This commit is contained in:
Francis Lachapelle committed 2021-11-04 16:43:35 -04:00
1 parent b622665359
commit 262400a92e
8 files changed
+187 -42

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
import config from '../lib/config'
import { mkdtempSync, rmSync } from 'fs'
const os = require('os')
const path = require('path')
const { execSync } = require('child_process')
describe('sogo-tool tests', function() {
let tmpdir
beforeEach(function() {
tmpdir = mkdtempSync(path.join(os.tmpdir(), 'sogo-'))
})
afterEach(function() {
rmSync(tmpdir, { recursive: true, force: true })
})
it('backup', async function() {
execSync(`sogo-tool backup ${tmpdir} ${config.username}`, (error, stdout, stderr) => {
expect(error).not.toBeDefined()
})
})
})