<commit_before>const assert = require( "assert" );
const path = require( "path" );
const childProcess = require( "child_process" );

describe( "glyphhanger cli", function() {

	it( "Produced a file", function (done) {
		childProcess.exec('node index.js --whitelist=ABC --subset=test/fonts/sourcesanspro-regular.ttf', function(err) {
      if (err) done(err)
      else done();
		})
	})
});<commit_msg>Improves initial CLI test and cleanup<commit_after>var assert = require( "assert" );
var path = require( "path" );
var childProcess = require( "child_process" );
var fs = require( "fs" );

var fontPath = "test/fonts/sourcesanspro-regular.ttf"

var removeFile = function( filePath ) {
	fs.unlinkSync( filePath );
}

describe( "glyphhanger cli", function() {
	it( "Produced a file", function ( done ) {
		childProcess.exec(`node index.js --whitelist=ABC --subset=${fontPath} --formats=ttf`, function(err) {
      if ( err ) {
				done( err );
			} else {
				var subsetPath = fontPath.split( ".ttf" ).join( "-subset.ttf" )
				var subset = fs.existsSync( subsetPath );
				assert.ok( subset );
				removeFile( subsetPath );
				done();
			};
		})
	})
});
{'fraction_non_alphanumeric': 0.16652211621856028, 'fraction_numerical': 0.0, 'mean_word_length': 3.808333333333333, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1242309', 'n_tokens_mistral': 420, 'n_tokens_neox': 383, 'n_words': 98}