<commit_before>describe('instances', function () {
  var Observable = require('../../../../../../lib/observable')
  it('fires condition trigger', function (done) {
    var cnt = 0
    var a = new Observable({
      on: {
        data: {
          condition: function (data, done, event) {
            setTimeout(done, 10)
          },
          val: function () {
            cnt++
            if (cnt === 2) {
              done()
            }
          }
        }
      }
    })
    var b = new a.Constructor()
    a.val = 'a change!'
  })
})

describe('context', function () {
  var Observable = require('../../../../../../lib/observable')
  it('fires condition trigger', function (done) {
    var cnt = 0
    var dataCnt = 0
    var fired = []
    var a = new Observable({
      key: 'a',
      time: 10,
      on: {
        data: {
          condition: function (data, done, event) {

            setTimeout(() => done(), this.time.val)
          },
          val: function (data) {
            fired.push(this.path[0])
            cnt++
            if(data === 'a change!') {
              dataCnt++
            }
            if (cnt === 5 && dataCnt === 3) {

              // expect(fired).to.deep.eql(['b', 'c', 'a', 'b', 'c'])
              done()
            }
          }
        }
      }
    })
    // behaviour now is fire for each -- im fix operator first
    // then we have batch
    // think about the inputs what to do with them -- context will become a nightmare -- context condition is only from the original
    // -- last things are fired with wrong time i geuss (the a time)
    var b = new a.Constructor({time: 200, key: 'b'})
    var c = new b.Constructor({time: 30, key: 'c'})
    a.val = 'a change!'
  })
})<commit_msg>start of extra condition tests<commit_after>describe('instances', function () {
  var Observable = require('../../../../../../lib/observable')
  it('fires condition trigger', function (done) {
    var cnt = 0
    var a = new Observable({
      on: {
        data: {
          condition: function (data, done, event) {
            setTimeout(done, 10)
          },
          val: function () {
            cnt++
            if (cnt === 2) {
              done()
            }
          }
        }
      }
    })
    var b = new a.Constructor()
    a.val = 'a change!'
  })
})

describe('context', function () {
  var Observable = require('../../../../../../lib/observable')
  it('fires condition trigger', function (done) {
    var cnt = 0
    var dataCnt = 0
    var fired = []
    var a = new Observable({
      key: 'a',
      time: 10,
      on: {
        data: {
          condition: function (data, done, event) {

            setTimeout(() => done(), this.time.val)
          },
          val: function (data) {
            fired.push(this.path[0])
            cnt++
            if(data === 'a change!') {
              dataCnt++
            }
            if (cnt === 5 && dataCnt === 3) {

              // expect(fired).to.deep.eql(['b', 'c', 'a', 'b', 'c'])
              done()
            }
          }
        }
      }
    })
    // behaviour now is fire for each -- im fix operator first
    // then we have batch
    // think about the inputs what to do with them -- context will become a nightmare -- context condition is only from the original
    // -- last things are fired with wrong time i geuss (the a time)
    var b = new a.Constructor({time: 200, key: 'b'})
    var c = new b.Constructor({time: 30, key: 'c'})
    a.val = 'a change!'
  })


  describe('childConstructors', function () {
    // var bla = new Observable({
    //   on: {
    //     data: {
    //       condition () {
    //         console.log('????')
    //       }
    //     }
    //   }
    // })
    //
    // var blax = new Observable({
    //   ChildConstructor: new Observable({
    //     on: {
    //       data: {
    //         condition () {
    //
    //         }
    //       }
    //     },
    //     ChildConstructor: 'Constructor'
    //   }).Constructor
    // })
    //
    // var blaxx = new Observable({
    //   xxxx: {}
    // })
  })
})
{'fraction_non_alphanumeric': 0.16760048721071863, 'fraction_numerical': 0.00779537149817296, 'mean_word_length': 1.3530085959885387, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '255134', 'n_tokens_mistral': 1238, 'n_tokens_neox': 1197, 'n_words': 352}