<commit_before>CoffeeCompileView = require '../lib/coffee-compile-view'
{WorkspaceView} = require 'atom'

describe "CoffeeCompile compile on save without preview", ->
  beforeEach ->
    atom.workspaceView = new WorkspaceView
    atom.workspace     = atom.workspaceView.model
    spyOn CoffeeCompileView, "saveCompiled"

  it "should call savedCompiled", ->
    atom.config.set("coffee-compile.compileOnSaveWithoutPreview", true)

    waitsForPromise "coffee-compile package to activate", ->
      atom.packages.activatePackage('coffee-compile')

    atom.workspaceView.attachToDom()

    waitsForPromise "fixture file to open", ->
      atom.workspace.open "coffee-compile-fixtures.coffee"

    runs -><commit_msg>Updated test to activate coffee-script and set coffee-compile grammar<commit_after>CoffeeCompileView = require '../lib/coffee-compile-view'
{WorkspaceView} = require 'atom'

describe "CoffeeCompile compile on save without preview", ->
  beforeEach ->
    atom.workspaceView = new WorkspaceView
    atom.workspace     = atom.workspaceView.model
    spyOn CoffeeCompileView, "saveCompiled"

    waitsForPromise "language-coffee-script to activate", ->
      atom.packages.activatePackage('language-coffee-script')

    atom.config.set('coffee-compile.grammars', [
      'source.coffee'
      'source.litcoffee'
      'text.plain'
      'text.plain.null-grammar'
    ])

  it "should call savedCompiled", ->
    atom.config.set("coffee-compile.compileOnSaveWithoutPreview", true)

    waitsForPromise "coffee-compile package to activate", ->
      atom.packages.activatePackage('coffee-compile')

    atom.workspaceView.attachToDom()

    waitsForPromise "fixture file to open", ->
      atom.workspace.open "coffee-compile-fixtures.coffee"

    runs ->
{'fraction_non_alphanumeric': 0.11218130311614731, 'fraction_numerical': 0.0, 'mean_word_length': 3.811989100817439, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 16, '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': '2952770', 'n_tokens_mistral': 555, 'n_tokens_neox': 518, 'n_words': 104}