6c3e92e48a
subrepo: subdir: "dotfiles/.vim/plugged/coc.nvim" merged: "7ca7cb915" upstream: origin: "https://github.com/neoclide/coc.nvim.git" branch: "master" commit: "7ca7cb915" git-subrepo: version: "0.4.3" origin: "???" commit: "???"
21 lines
617 B
JavaScript
21 lines
617 B
JavaScript
const path = require('path')
|
|
const os = require('os')
|
|
const fs = require('fs')
|
|
|
|
process.on('uncaughtException', err => {
|
|
let msg = 'Uncaught exception: ' + err.stack
|
|
console.error(msg)
|
|
})
|
|
|
|
process.on('exit', () => {
|
|
fs.rmdirSync(process.env.TMPDIR, { recursive: true, force: true })
|
|
})
|
|
|
|
module.exports = async () => {
|
|
let dataHome = path.join(os.tmpdir(), `coc-test/${process.pid}`)
|
|
fs.mkdirSync(dataHome, { recursive: true })
|
|
process.env.NODE_ENV = 'test'
|
|
process.env.COC_DATA_HOME = dataHome
|
|
process.env.COC_VIMCONFIG = path.join(__dirname, 'src/__tests__')
|
|
process.env.TMPDIR = '/tmp/coc-test'
|
|
}
|