<commit_before>import { expect } from 'chai'
import { DelegableProxy } from '../src/DelegableProxy'


// actual test set
const myset = [
  {'foo': 'bar'},
  {'foo2': 'bar2'},
  {'ultimate': [{
      'id': 1,
      'pew': 'POW',
      'pow?': 'PHEW!'
    }, {
      'id': 2,
      'pew': 'POW',
      'pow?': 'PHEW!'
    }
  ]}
]

function traverse(o) {
  if (typeof o !== 'object') {
    return
  }

  const isProxy = (o instanceof Proxy) // dont work
  console.log('isProxy', isProxy)

  for (var k in o) {
    console.log('key', k)
    console.log('object', o)
    traverse(o[k])
  }
}

const WHOOPERINIO = function cb(action, sender) {
  console.log('smells like someone just whooped')
}

const mysetProxy = new DelegableProxy(myset, WHOOPERINIO)
// traverse(mysetProxy)

describe('bla', () => {
  it('Should blub', () => {
    expect(true).to.be.true<commit_msg>Wait for expectation the ugly way.<commit_after>import { expect } from 'chai'
import { DelegableProxy } from '../src/DelegableProxy'


// actual test set
const myset = [
  {'foo': 'bar'},
  {'foo2': 'bar2'},
  {'ultimate': [{
      'id': 1,
      'pew': 'POW',
      'pow?': 'PHEW!'
    }, {
      'id': 2,
      'pew': 'POW',
      'pow?': 'PHEW!'
    }
  ]}
]

function traverse(o) {
  if (typeof o !== 'object') {
    return
  }

  const isProxy = (o instanceof Proxy) // dont work
  console.log('isProxy', isProxy)

  for (var k in o) {
    console.log('key', k)
    console.log('object', o)
    traverse(o[k])
  }
}

// traverse(mysetProxy)

describe('bla', () => {
  it('Should blub', (done) => {
    let actual = false
    const WHOOPERINIO = function cb(action, sender) {
      console.log('smells like someone just whooped')
      actual = true
    }
    const mysetProxy = new DelegableProxy(myset, WHOOPERINIO)
    mysetProxy.push({'barfoo': 'yeap'})

    setTimeout(() => {
      expect(actual).to.be.true
      done()
    }, 10)
{'fraction_non_alphanumeric': 0.18877818563188253, 'fraction_numerical': 0.005243838489774515, 'mean_word_length': 2.7338551859099804, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '1299858', 'n_tokens_mistral': 734, 'n_tokens_neox': 707, 'n_words': 167}