<commit_before>const chai = require('chai')
const sinonChai = require('sinon-chai')
const expect = chai.expect
chai.use(sinonChai)

const semver = require('semver')
const { checkIfRunningOnSupportedNodeVersion } = require('../../lib/startup/validatePreconditions')

describe('preconditionValidation', () => {
  describe('checkIfRunningOnSupportedNodeVersion', () => {
    const supportedVersion = require('./../../package.json').engines.node

    it('should define the supported semver range as 8 - 10', () => {
      expect(supportedVersion).to.equal('8 - 10')
      expect(semver.validRange(supportedVersion)).to.not.equal(null)
    })

    it('should accept a supported version', () => {
      expect(checkIfRunningOnSupportedNodeVersion('10.12.0')).to.equal(true)
      expect(checkIfRunningOnSupportedNodeVersion('9.11.2')).to.equal(true)
      expect(checkIfRunningOnSupportedNodeVersion('8.12.0')).to.equal(true)
    })

    it('should fail for an unsupported version', () => {
      expect(checkIfRunningOnSupportedNodeVersion('7.10.1')).to.equal(false)
      expect(checkIfRunningOnSupportedNodeVersion('6.14.4')).to.equal(false)
      expect(checkIfRunningOnSupportedNodeVersion('4.9.1')).to.equal(false)
      expect(checkIfRunningOnSupportedNodeVersion('0.12.8')).to.equal(false)
    })
  })
})<commit_msg>Adapt test preconditions to new node.js range<commit_after>const chai = require('chai')
const sinonChai = require('sinon-chai')
const expect = chai.expect
chai.use(sinonChai)

const semver = require('semver')
const { checkIfRunningOnSupportedNodeVersion } = require('../../lib/startup/validatePreconditions')

describe('preconditionValidation', () => {
  describe('checkIfRunningOnSupportedNodeVersion', () => {
    const supportedVersion = require('./../../package.json').engines.node

    it('should define the supported semver range as 8 - 11', () => {
      expect(supportedVersion).to.equal('8 - 11')
      expect(semver.validRange(supportedVersion)).to.not.equal(null)
    })

    it('should accept a supported version', () => {
expect(checkIfRunningOnSupportedNodeVersion('11.3.0')).to.equal(true)
      expect(checkIfRunningOnSupportedNodeVersion('10.12.0')).to.equal(true)
      expect(checkIfRunningOnSupportedNodeVersion('9.11.2')).to.equal(true)
      expect(checkIfRunningOnSupportedNodeVersion('8.12.0')).to.equal(true)
    })

    it('should fail for an unsupported version', () => {
      expect(checkIfRunningOnSupportedNodeVersion('7.10.1')).to.equal(false)
      expect(checkIfRunningOnSupportedNodeVersion('6.14.4')).to.equal(false)
      expect(checkIfRunningOnSupportedNodeVersion('4.9.1')).to.equal(false)
      expect(checkIfRunningOnSupportedNodeVersion('0.12.8')).to.equal(false)
    })
  })
})
{'fraction_non_alphanumeric': 0.16106647187728268, 'fraction_numerical': 0.026296566837107377, 'mean_word_length': 4.8152866242038215, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '1071937', 'n_tokens_mistral': 855, 'n_tokens_neox': 834, 'n_words': 109}