<commit_before>describe 'seeder', ->
  context 'when 2 lines of csv file', ->
    beforeEach ->
      @timeout 10000

      knex('users').del().then ->
        Promise.all [
          knex('users').insert id: 1, name: 'foo'
          knex('users').insert id: 2, name: 'bar'
        ]

    it 'import the seed', ->
      @timeout 10000

      @seeder = seeder(table: 'users', file: __dirname + '/fixtures/users_utf8.csv', encoding: 'utf8')
      @seeder(knex, Promise).then (res) ->
        deletedCount = res.shift()
        assert.ok deletedCount == 2

        insertedRows = res.shift()
        assert.ok insertedRows.shift() == 2

  context 'when 1 lines of invalid csv file', ->
    beforeEach ->
      @timeout 10000

      knex('users').del().then ->
        Promise.all [
          knex('users').insert id: 1, name: 'foo'
          knex('users').insert id: 2, name: 'bar'
        ]
<commit_msg>clean up users table <commit_after>describe 'seeder', ->
  context 'when 2 lines of csv file', ->
    beforeEach ->
      @timeout 10000

      knex('users').del().then ->
        Promise.all [
          knex('users').insert id: 1, name: 'foo'
          knex('users').insert id: 2, name: 'bar'
        ]

    it 'import the seed', ->
      @timeout 10000

      @seeder = seeder(table: 'users', file: __dirname + '/fixtures/users_utf8.csv', encoding: 'utf8')
      @seeder(knex, Promise).then (res) ->
        deletedCount = res.shift()
        assert.ok deletedCount == 2

        insertedRows = res.shift()
        assert.ok insertedRows.shift() == 2

  context 'when 1 lines of invalid csv file', ->
    beforeEach ->
      @timeout 10000

      knex('users').del().then ->
        Promise.all [
          knex('users').insert id: 1, name: 'foo'
          knex('users').insert id: 2, name: 'bar'
        ]

    afterEach ->
      knex('users').del()

{'fraction_non_alphanumeric': 0.156957928802589, 'fraction_numerical': 0.02696871628910464, 'mean_word_length': 2.0968280467445743, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 22, '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': '3904432', 'n_tokens_mistral': 629, 'n_tokens_neox': 567, 'n_words': 154}