<commit_before>const should  = require('should')
const expect = require('expect.js')
const sinon  = require('sinon')
const helper = require('./helper')
const {ImdoneRepoWorkerProxy} = require('../lib/repo-worker-proxy')
const Task = require('../lib/task')
const File = require('../lib/file')

describe('ImdoneRepoWorkerProxy', function () {
  let repo
  beforeEach(function () {
    repo = new ImdoneRepoWorkerProxy(helper.getFreshRepo())
  })
  afterEach(function (done) {
    setTimeout(() => {
      repo.destroy()
      done()
    }, 500)
  })
  describe('init', function () {
    it('should initialize an imdone repo and emit it\'s lists', function(done) {
      repo.on('initialized', ({ok, lists}) => {
        should(ok).be.true
        should(lists).be.an.object
        done()
      })
      repo.init()
    })
  })
  describe('modifyTask', function () {
    it('should successfuly modify the metaData', function(done) {
      repo.on('initialized', ({ok, lists}) => {
        let list = lists.find(list => list.name === 'DONE')
        let task = list.tasks[0]
        task.addMetaData('id', 22)
        repo.on('file.saved', (file) => {
          let task = file.getTask(22)
          should(task).be.an.object
          done()
        })
        repo.modifyTask(task, true)
      })
      repo.init()
    })
  })
  // DOING: Add moveTasks Tests
})<commit_msg>Automatically merged TODO updates by imdone.io [ci skip] [imdone skip]<commit_after>const should  = require('should')
const expect = require('expect.js')
const sinon  = require('sinon')
const helper = require('./helper')
const {ImdoneRepoWorkerProxy} = require('../lib/repo-worker-proxy')
const Task = require('../lib/task')
const File = require('../lib/file')

describe('ImdoneRepoWorkerProxy', function () {
  let repo
  beforeEach(function () {
    repo = new ImdoneRepoWorkerProxy(helper.getFreshRepo())
  })
  afterEach(function (done) {
    setTimeout(() => {
      repo.destroy()
      done()
    }, 500)
  })
  describe('init', function () {
    it('should initialize an imdone repo and emit it\'s lists', function(done) {
      repo.on('initialized', ({ok, lists}) => {
        should(ok).be.true
        should(lists).be.an.object
        done()
      })
      repo.init()
    })
  })
  describe('modifyTask', function () {
    it('should successfuly modify the metaData', function(done) {
      repo.on('initialized', ({ok, lists}) => {
        let list = lists.find(list => list.name === 'DONE')
        let task = list.tasks[0]
        task.addMetaData('id', 22)
        repo.on('file.saved', (file) => {
          let task = file.getTask(22)
          should(task).be.an.object
          done()
        })
        repo.modifyTask(task, true)
      })
      repo.init()
    })
  })
  // DOING: Add moveTasks Tests id:20 gh:107
})
{'fraction_non_alphanumeric': 0.17022032693674485, 'fraction_numerical': 0.007462686567164179, 'mean_word_length': 2.689384010484928, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '4859400', 'n_tokens_mistral': 888, 'n_tokens_neox': 881, 'n_words': 189}