<commit_before>"use babel"
/*eslint-env jasmine */

import parseCode from '../lib/parse-code.js'

describe("makeCache.parseCode", function() {
<commit_msg>Add a spec to verify all files parse<commit_after>"use babel"
/*eslint-env jasmine */

import parseCode from '../lib/parse-code.js'
import fs from 'fs'
import path from 'path'

describe("makeCache.parseCode", function() {

    it("can parse every file in js-hyperclick", function() {
        const filenames = [
            './parse-code-spec.js',
            '../lib/js-hyperclick.js',
            '../lib/make-cache.js',
            '../lib/parse-code.js',
            '../lib/suggestions.js',
            '../.eslintrc.js'
        ]

        filenames.forEach(name => {
            const fullFilename = path.join(__dirname, name)
            const code = String(fs.readFileSync(fullFilename))

            const { parseError } = parseCode(code)
            expect(parseError && parseError.message).toBeUndefined(fullFilename)
        })
    })

{'fraction_non_alphanumeric': 0.1497005988023952, 'fraction_numerical': 0.0, 'mean_word_length': 2.2564935064935066, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '6504173', 'n_tokens_mistral': 303, 'n_tokens_neox': 299, 'n_words': 63}