<commit_before>/**
 * Test the expected data files in ./src/assets/data
 */

/* global describe it */
const chai = require('chai')
const path = require('path')
const fs = require('fs')

chai.should()

describe('History file', function () {
  it('should be generated', function () {
    fs.existsSync('./src/assets/data/history.json').should.be.true
  })
})

describe('Metadata file', function () {
  it('should be generated', function () {
    fs.existsSync('./src/assets/data/metadata.json').should.be.true
  })
})

describe('Season data files', function () {
  it('should be generated', function () {
    // Get a list of seasons from the ./data directory
    let seasons = fs.readdirSync('./data').filter(file => {
      return fs.statSync(path.join('./data', file)).isDirectory()
    })

    seasons.forEach(season => {
      fs.existsSync(`./src/assets/data/season-${season}.json`).should.be.true
    })
  })
})
<commit_msg>Update test to use `latest` as a season identifier<commit_after>/**
 * Test the expected data files in ./src/assets/data
 */

/* global describe it */
const chai = require('chai')
const path = require('path')
const fs = require('fs')

chai.should()

describe('History file', function () {
  it('should be generated', function () {
    fs.existsSync('./src/assets/data/history.json').should.be.true
  })
})

describe('Metadata file', function () {
  it('should be generated', function () {
    fs.existsSync('./src/assets/data/metadata.json').should.be.true
  })
})

describe('Season data files', function () {
  it('should be generated', function () {
    // Get a list of seasons from the ./data directory
    let seasons = fs.readdirSync('./data').filter(file => {
      return fs.statSync(path.join('./data', file)).isDirectory()
    })
    seasons[seasons.length - 1] = 'latest'

    seasons.forEach(season => {
      fs.existsSync(`./src/assets/data/season-${season}.json`).should.be.true
    })
  })
})

{'fraction_non_alphanumeric': 0.18524251805985553, 'fraction_numerical': 0.0005159958720330237, 'mean_word_length': 3.4269406392694064, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '3184690', 'n_tokens_mistral': 599, 'n_tokens_neox': 590, 'n_words': 135}