<commit_before>chai = require('chai')
expect = chai.expect

fs = require('fs')
path = require('path')
Buffer = require('buffer').Buffer

WordExtractor = require('../src/word')
Document = require('../src/document')

describe 'Word file test04.doc', () ->

  extractor = new WordExtractor()

  it 'should match the expected body', (done) ->
    extract = extractor.extract path.resolve(__dirname, "data/test04.doc")
    expect(extract).to.be.fulfilled
    extract
      .then (result) ->
        body = result.getBody()
        expect(body).to.match new RegExp('Moli\\u00e8re')
        done()<commit_msg>Added test for headers and footers<commit_after>chai = require('chai')
expect = chai.expect

fs = require('fs')
path = require('path')
Buffer = require('buffer').Buffer

WordExtractor = require('../src/word')
Document = require('../src/document')

describe 'Word file test04.doc', () ->

  extractor = new WordExtractor()

  it 'should match the expected body', (done) ->
    extract = extractor.extract path.resolve(__dirname, "data/test04.doc")
    expect(extract).to.be.fulfilled
    extract
      .then (result) ->
        body = result.getBody()
        expect(body).to.match new RegExp('Moli\\u00e8re')
        done()

  it 'should have headers and footers', (done) ->
    extract = extractor.extract path.resolve(__dirname, "data/test04.doc")
    expect(extract).to.be.fulfilled
    extract
      .then (result) ->
        body = result.getHeaders()
        expect(body).to.match new RegExp('The footer')
        expect(body).to.match new RegExp('Moli\\u00e8re')
        done()
{'fraction_non_alphanumeric': 0.1557377049180328, 'fraction_numerical': 0.01197982345523329, 'mean_word_length': 3.2776280323450133, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '2336705', 'n_tokens_mistral': 506, 'n_tokens_neox': 489, 'n_words': 113}