<commit_before>/* eslint-env babel-eslint, node, mocha */

import fs from 'fs'
import path from 'path'
const expect = require('chai').expect

import { requireExtension } from '../src/extensions'

//TODO: Require works for edition (Ultimate C, Pro A, Lite A)
//TODO: Require works for downgrade (Ultimate -> Pro) A
//TODO: Require works for downgrade (Ultimate -> Lite) B
//TODO: Require works for downgrade (Pro -> Lite) B
//TODO: Throws correctly (D)

describe('Extensions Loader', () => {
  const tmpFiles = []
  const writeFile = (path, content) => {
    tmpFiles.push(path)
    fs.writeFileSync(path, content)
  }

  before(function() {

    const extensionPath = (edition, file) => path.resolve(__dirname, '../extensions', edition, file)
    const fileContent = edition => `module.exports = () => '${edition}'`

    writeFile(extensionPath('lite', 'b.js'), fileContent('lite'))
    writeFile(extensionPath('pro', 'a.js'), fileContent('pro'))
    writeFile(extensionPath('ultimate', 'c.js'), fileContent('ultimate'))
    
  })

  after(function() {
    tmpFiles.forEach(f => fs.unlinkSync(f))
  })

  it('Require works for edition', function() {<commit_msg>Remove test todo list<commit_after>/* eslint-env babel-eslint, node, mocha */

import fs from 'fs'
import path from 'path'
const expect = require('chai').expect

import { requireExtension } from '../src/extensions'

describe('Extensions Loader', () => {
  const tmpFiles = []
  const writeFile = (path, content) => {
    tmpFiles.push(path)
    fs.writeFileSync(path, content)
  }

  before(function() {

    const extensionPath = (edition, file) => path.resolve(__dirname, '../extensions', edition, file)
    const fileContent = edition => `module.exports = () => '${edition}'`

    writeFile(extensionPath('lite', 'b.js'), fileContent('lite'))
    writeFile(extensionPath('pro', 'a.js'), fileContent('pro'))
    writeFile(extensionPath('ultimate', 'c.js'), fileContent('ultimate'))
    
  })

  after(function() {
    tmpFiles.forEach(f => fs.unlinkSync(f))
  })

  it('Require works for edition', function() {
{'fraction_non_alphanumeric': 0.17124939700916547, 'fraction_numerical': 0.0, 'mean_word_length': 4.211055276381909, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 18, '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': '4075609', 'n_tokens_mistral': 666, 'n_tokens_neox': 642, 'n_words': 166}