<commit_before>'use strict';

var expect = require('chai').expect;
var cordovaSetVersion = require('../src/index');
var fs = require('fs-extra');

var goodPath = './test/config.good.xml';
var badPath = './test/config.bad.xml';
var missingPath = './test/config.missing.xml';
var configPath = './test/config.xml';
var expectedConfigPath = './test/config.expected.xml';
var fileParams = { encoding: 'UTF-8' };

describe('cordova-set-version', () => {
    it('should exist', () => {
        expect(cordovaSetVersion).to.exist;
    });

    describe('setVersion', () => {
        beforeEach(() => {
            fs.copySync(goodPath, configPath);
        });

        it('should exist', () => {
            expect(cordovaSetVersion).to.have.property('setVersion');
        });

        it('should be a function', () => {
            expect(typeof cordovaSetVersion.setVersion).to.equal('function');
        });

        it('should produce same content as in `config.expected.xml` when passed the argument `1.0.0`', (done) => {
            cordovaSetVersion.setVersion(configPath, '1.0.0', function (error) {
                expect(error).to.not.exist;
<commit_msg>test: change all requires to const<commit_after>'use strict';

const expect = require('chai').expect;
const cordovaSetVersion = require('../src/index');
const fs = require('fs-extra');

const goodPath = './test/config.good.xml';
const badPath = './test/config.bad.xml';
const missingPath = './test/config.missing.xml';
const configPath = './test/config.xml';
const expectedConfigPath = './test/config.expected.xml';
const fileParams = { encoding: 'UTF-8' };

describe('cordova-set-version', () => {
    it('should exist', () => {
        expect(cordovaSetVersion).to.exist;
    });

    describe('setVersion', () => {
        beforeEach(() => {
            fs.copySync(goodPath, configPath);
        });

        it('should exist', () => {
            expect(cordovaSetVersion).to.have.property('setVersion');
        });

        it('should be a function', () => {
            expect(typeof cordovaSetVersion.setVersion).to.equal('function');
        });

        it('should produce same content as in `config.expected.xml` when passed the argument `1.0.0`', (done) => {
            cordovaSetVersion.setVersion(configPath, '1.0.0', function (error) {
                expect(error).to.not.exist;

{'fraction_non_alphanumeric': 0.17961783439490445, 'fraction_numerical': 0.0059447983014862, 'mean_word_length': 2.9006622516556293, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 12}, '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': '3580319', 'n_tokens_mistral': 701, 'n_tokens_neox': 688, 'n_words': 135}