<commit_before>'use strict'

const createStream = require('../../core/providers/facebook/stream')
const { first, keys } = require('lodash')
const should = require('should')

const CONST = {
  EXPECTED_FIELDS: [
    'title',
    'updatedAt',
    'url'
  ]
}

describe('provider » facebook', function () {
  describe('stream', function () {
    it(`${CONST.EXPECTED_FIELDS.toString()} are present`, function (done) {
      const stream = createStream()
      const buffer = []

      stream
        .on('data', buffer.push.bind(buffer))
        .on('end', function () {
          const item = first(buffer)
          const itemKey = keys(item)
          itemKey.should.be.eql(CONST.EXPECTED_FIELDS)
          done()
        })
    })
  })
})<commit_msg>Fix lint<commit_after>'use strict'

const createStream = require('../../core/providers/facebook/stream')
const { first, keys } = require('lodash')
require('should')

const CONST = {
  EXPECTED_FIELDS: [
    'title',
    'updatedAt',
    'url'
  ]
}

describe('provider » facebook', function () {
  describe('stream', function () {
    it(`${CONST.EXPECTED_FIELDS.toString()} are present`, function (done) {
      const stream = createStream()
      const buffer = []

      stream
        .on('data', buffer.push.bind(buffer))
        .on('end', function () {
          const item = first(buffer)
          const itemKey = keys(item)
          itemKey.should.be.eql(CONST.EXPECTED_FIELDS)
          done()
        })
    })
  })
})
{'fraction_non_alphanumeric': 0.16261808367071526, 'fraction_numerical': 0.0, 'mean_word_length': 2.625916870415648, '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': '496865', 'n_tokens_mistral': 466, 'n_tokens_neox': 465, 'n_words': 93}