<commit_before>import chai from 'chai';
import fs from 'fs';
import { GCodeParser, parseFile, parseString, parseStream } from '../lib/';
import _ from 'lodash';

const expect = chai.expect;
const should = chai.should();

describe('G-code Parser', (done) => {
    describe('Pass a null value as the first argument', (done) => {
        it('should call parseString\'s callback.', (done) => {
            parseString(null, (err, results) => {
                expect(err).to.be.okay;
                done();
            });
        });
        it('should call parseFile\'s callback.', (done) => {
            parseFile(null, (err, results) => {
                expect(err).to.be.okay;
                done();
            });
        });
        it('should call parseStream\'s callback.', (done) => {
            parseStream(null, (err, results) => {
                expect(err).to.be.okay;
                done();
            });
        });
    });

    describe('Pass an empty text as the first argument', (done) => {
        it('should get empty results.', (done) => {
            let sampleText = '';
            parseString(sampleText, (err, results) => {
                expect(results.length).to.be.empty;
                done();
            });
        });
    });

    describe('Contains only comments', (done) => {
        it('should be 11 lines.', (done) => {
            let sampleText = [
                ';',
                '; Operation:    0',
                '; Name:',         
                '; Type:         Pocket',
                '; Paths:        3',
                '; Direction:    Conventional',
                '; Cut Depth:    3.175',
                '; Pass Depth:   1.9999999999999998',
                '; Plunge rate:  127',
                '; Cut rate:     1016',
                '  ' // empty line
            ].join('\n');

            parseString(sampleText, (err, results) => {
                expect(results.length).to.be.equal(11);
                done();
            });
        });
    });

    describe('File not found exception', (done) => {
        it('should fail the callback if a file is not present.', (done) => {
            parseFile('test/fixtures/NO_FILE_ERROR', (err, results) => {
                expect(err).to.not.be.null;
                expect(err.code).to.equal('ENOENT');
                done();
            });
        });
    });

    describe('Event listeners', (done) => {<commit_msg>Skip empty lines<commit_after>import chai from 'chai';
import fs from 'fs';
import { GCodeParser, parseFile, parseString, parseStream } from '../lib/';
import _ from 'lodash';

const expect = chai.expect;
const should = chai.should();

describe('G-code Parser', (done) => {
    describe('Pass a null value as the first argument', (done) => {
        it('should call parseString\'s callback.', (done) => {
            parseString(null, (err, results) => {
                expect(err).to.be.okay;
                done();
            });
        });
        it('should call parseFile\'s callback.', (done) => {
            parseFile(null, (err, results) => {
                expect(err).to.be.okay;
                done();
            });
        });
        it('should call parseStream\'s callback.', (done) => {
            parseStream(null, (err, results) => {
                expect(err).to.be.okay;
                done();
            });
        });
    });

    describe('Pass an empty text as the first argument', (done) => {
        it('should get empty results.', (done) => {
            let sampleText = '';
            parseString(sampleText, (err, results) => {
                expect(results.length).to.be.empty;
                done();
            });
        });
    });

    describe('Contains only comments', (done) => {
        it('should be 10 non-empty lines.', (done) => {
            let sampleText = [
                ';',
                '; Operation:    0',
                '; Name:',         
                '; Type:         Pocket',
                '; Paths:        3',
                '; Direction:    Conventional',
                '; Cut Depth:    3.175',
                '; Pass Depth:   1.9999999999999998',
                '; Plunge rate:  127',
                '; Cut rate:     1016',
                '  ' // skip empty line
            ].join('\n');

            parseString(sampleText, (err, results) => {
                expect(results.length).to.be.equal(10);
                done();
            });
        });
    });

    describe('File not found exception', (done) => {
        it('should fail the callback if a file is not present.', (done) => {
            parseFile('test/fixtures/NO_FILE_ERROR', (err, results) => {
                expect(err).to.not.be.null;
                expect(err.code).to.equal('ENOENT');
                done();
            });
        });
    });

    describe('Event listeners', (done) => {
{'fraction_non_alphanumeric': 0.15960048919690176, 'fraction_numerical': 0.013860578883000407, 'mean_word_length': 1.405392156862745, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '7169035', 'n_tokens_mistral': 1429, 'n_tokens_neox': 1302, 'n_words': 308}