<commit_before>Pigments = require '../lib/pigments'
PigmentsAPI = require '../lib/pigments-api'

SERIALIZE_VERSION = "1.0.1"

describe "Pigments", ->
  [workspaceElement, pigments, project] = []

  beforeEach ->
    workspaceElement = atom.views.getView(atom.workspace)
    jasmine.attachToDOM(workspaceElement)

    waitsForPromise -> atom.packages.activatePackage('pigments').then (pkg) ->
      pigments = pkg.mainModule
      project = pigments.getProject()

  it 'instanciates a ColorProject instance', ->
    expect(pigments.getProject()).toBeDefined()

  it 'serializes the project', ->
    date = new Date
    spyOn(pigments.getProject(), 'getTimestamp').andCallFake -> date
    expect(pigments.serialize()).toEqual({
      project:
        deserializer: 'ColorProject'
        timestamp: date
        version: SERIALIZE_VERSION
        buffers: {}
    })

  describe 'service provider API', ->
    [service, editor, editorElement, buffer] = []
    beforeEach -><commit_msg>:construction: Add log to debug Travis failures<commit_after>Pigments = require '../lib/pigments'
PigmentsAPI = require '../lib/pigments-api'

SERIALIZE_VERSION = "1.0.1"

fdescribe "Pigments", ->
  [workspaceElement, pigments, project] = []

  beforeEach ->
    workspaceElement = atom.views.getView(atom.workspace)
    jasmine.attachToDOM(workspaceElement)


    # atom.config.set('pigments.sourceNames', ['**/*.sass', '**/*.styl'])
    # atom.config.set('pigments.ignoredNames', [])
    # atom.config.set('pigments.autocompleteScopes', [])

    waitsForPromise -> atom.packages.activatePackage('pigments').then (pkg) ->
      console.log atom.config.get('pigments')
      pigments = pkg.mainModule
      project = pigments.getProject()

  it 'instanciates a ColorProject instance', ->
    expect(pigments.getProject()).toBeDefined()

  it 'serializes the project', ->
    date = new Date
    spyOn(pigments.getProject(), 'getTimestamp').andCallFake -> date
    expect(pigments.serialize()).toEqual({
      project:
        deserializer: 'ColorProject'
        timestamp: date
        version: SERIALIZE_VERSION
        buffers: {}
    })

  describe 'service provider API', ->
    [service, editor, editorElement, buffer] = []
    beforeEach ->
{'fraction_non_alphanumeric': 0.14131897711978467, 'fraction_numerical': 0.0026917900403768506, 'mean_word_length': 3.48692152917505, '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': '2101224', 'n_tokens_mistral': 703, 'n_tokens_neox': 686, 'n_words': 129}