<commit_before>'use babel'

import * as _ from 'lodash'
import * as path from 'path'

describe('The hunspell provider for Atom Linter', () => {
  const lint = require('../lib/main').provideLinter().lint

  beforeEach(() => {
    waitsForPromise(() => {
      atom.packages.activatePackage('language-latex')
      return atom.packages.activatePackage('linter-hunspell')
    })
  })

  it('finds a spelling in "foo.tex"', () => {
    waitsForPromise(() => {
      return atom.workspace.open(path.join(__dirname, 'files', 'foo.tex')).then(editor => {
        return lint(editor, "text.tex.latex").then(messages => {
          for (const message of messages) {
            console.log(message.text)
          }
          expect(_.some(messages, (message) => { return message.text.match(/^armour(:|$)/) })).toBe(true)
          expect(_.some(messages, (message) => { return message.text.match(/^travelling(:|$)/) })).toBe(true)
        })
      })
    })
  })
})<commit_msg>Tweaks<commit_after>'use babel'

import * as _ from 'lodash'
import * as path from 'path'

describe('The hunspell provider for Atom Linter', () => {
  const lint = require('../lib/main').provideLinter().lint

  beforeEach(() => {
    waitsForPromise(() => {
      atom.packages.activatePackage('language-latex')
      return atom.packages.activatePackage('linter-hunspell')
    })
  })

  it('finds a spelling in "foo.tex"', () => {
    waitsForPromise(() => {
      return atom.workspace.open(path.join(__dirname, 'files', 'foo.tex')).then(editor => {
        return lint(editor, 'text.tex.latex').then(messages => {
          expect(_.some(messages, (message) => { return message.text.match(/^armour(:|$)/) })).toBe(true)
          // expect(_.some(messages, (message) => { return message.text.match(/^travelling(:|$)/) })).toBe(true)
        })
      })
    })
  })
})
{'fraction_non_alphanumeric': 0.1967391304347826, 'fraction_numerical': 0.0, 'mean_word_length': 3.109375, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, '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': '1853748', 'n_tokens_mistral': 603, 'n_tokens_neox': 592, 'n_words': 102}