<commit_before>import fs from 'fs-extra'
import del from 'del'
import path from 'path'

import Config from '../../src/config'

export default {
  createConfig () {
    let parent = process.env.COZY_DESKTOP_DIR || 'tmp'
    const basePath = path.resolve(`${parent}/${+new Date()}`)
    this.syncPath = path.join(basePath, 'Cozy')
    fs.ensureDirSync(this.syncPath)
    this.config = new Config(path.join(basePath, '.cozy-desktop'))
    this.config.syncPath = this.syncPath
  },

  registerClient () {
    this.config.config.creds = {
      client: {
        clientID: process.env.COZY_CLIENT_ID || 'desktop',
        clientName: 'desktop',
        softwareID: 'cozy-desktop',
        redirectURI: 'http://localhost/'
      },
      token: {
        accessToken: process.env.COZY_STACK_TOKEN
      }
    }
  },

  cleanConfig () {
    return del.sync(this.syncPath)
  }
}<commit_msg>Allow deleting the config outside the current dir on Travis<commit_after>import fs from 'fs-extra'
import del from 'del'
import path from 'path'

import Config from '../../src/config'

export default {
  createConfig () {
    let parent = process.env.COZY_DESKTOP_DIR || 'tmp'
    const basePath = path.resolve(`${parent}/${+new Date()}`)
    this.syncPath = path.join(basePath, 'Cozy')
    fs.ensureDirSync(this.syncPath)
    this.config = new Config(path.join(basePath, '.cozy-desktop'))
    this.config.syncPath = this.syncPath
  },

  registerClient () {
    this.config.config.creds = {
      client: {
        clientID: process.env.COZY_CLIENT_ID || 'desktop',
        clientName: 'desktop',
        softwareID: 'cozy-desktop',
        redirectURI: 'http://localhost/'
      },
      token: {
        accessToken: process.env.COZY_STACK_TOKEN
      }
    }
  },

  cleanConfig () {
    return del.sync(this.syncPath, {force: process.env.TRAVIS})
  }
}
{'fraction_non_alphanumeric': 0.14464382816748234, 'fraction_numerical': 0.0, 'mean_word_length': 2.865546218487395, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5078540', 'n_tokens_mistral': 617, 'n_tokens_neox': 607, 'n_words': 121}