<commit_before>var assert = require('assert')
var fs = require('fs')

var main = require('../jcss.js')

describe('main', function () {
  it('should take require at least one arguments', function () {
    assert.equal(1, main())
  })
  it('should throw an error if the first argument is not a file', function () {
    assert.equal(1, main('notafile'))
  })
  it('should create the file passed as the second argument.', function () {
    var testFileName = 'testFile'
    var testString = 'div {display: block;}'
    function deleteTestFiles () {
      fs.unlink(testFileName + '.css')
      fs.unlink(testFileName + '.jcss')
    }
    fs.writeFile(testFile + '.jcss', testString, function () {
      main(testFile + '.jcss')
      fs.readdir('./', function (err, dir) {
        assert.ok(dir.indexOf(testFile + '.css') > -1)
        deleteTestFiles()
      })
    })
  })
})<commit_msg>Fix a bug in the tests for main<commit_after>var assert = require('assert')
var fs = require('fs')

var main = require('../jcss.js')

describe('main', function () {
  it('should take require at least one arguments', function () {
    assert.equal(1, main())
  })
  it('should throw an error if the first argument is not a file', function () {
    assert.equal(1, main('notafile'))
  })
  it('should create the file passed as the second argument.', function () {
    var testFileName = 'testFile'
    var testString = 'div {display: block;}'
    function deleteTestFiles () {
      fs.unlink(testFileName + '.css')
      fs.unlink(testFileName + '.jcss')
    }
    fs.writeFile(testFileName + '.jcss', testString, function () {
      main(testFileName + '.jcss')
      fs.readdir('./', function (err, dir) {
        assert.ok(dir.indexOf(testFileName + '.css') > -1)
        deleteTestFiles()
      })
    })
  })
})
{'fraction_non_alphanumeric': 0.16333333333333333, 'fraction_numerical': 0.0033333333333333335, 'mean_word_length': 3.074660633484163, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2676458', 'n_tokens_mistral': 554, 'n_tokens_neox': 551, 'n_words': 155}