<commit_before>var assert = require("chai").assert;
var xlsx = require("node-xlsx");
var parseAdditionalSheets = require(__dirname + "../../server/controllers/additional-sheet-parser");
var grnmapOutputWorkbookPath = __dirname + "/../test-files/spreadsheet-controller-test-files/" +
  "15-genes_28-edges_db5-MO-LK_Sigmoid_estimation_missing-values_output.xlsx";
var grnmapInputWorkbookPath = __dirname + "/../test-files/spreadsheet-controller-test-files/" +
    "15-genes_28-edges_db5-MO-LK_Sigmoid_estimation_missing-values.xlsx";

describe("additional-sheet-parser", function () {

    it("parses a GRNmap output workbook without throwing errors", function () {
        var workbook = xlsx.parse(grnmapOutputWorkbookPath);
        assert.doesNotThrow(function () {
            parseAdditionalSheets(workbook);
        });
    });

    it("parses a GRNmap input workbook without throwing errors", function () {
        var workbook = xlsx.parse(grnmapInputWorkbookPath);
        assert.doesNotThrow(function () {
            parseAdditionalSheets(workbook);
        });
    });

    it("handles missing data in _expression sheets", function () {
        var workbook = xlsx.parse(__dirname + "/../test-files/spreadsheet-controller-test-files/" +
        "log2_expression_with_missing_data.xlsx");
        var data = parseAdditionalSheets(workbook);
        assert(data,
            {"expression": {
                "wt_log2_expression": {<commit_msg>fixed path npm test error<commit_after>var assert = require("chai").assert;
var xlsx = require("node-xlsx");
var parseAdditionalSheets = require(__dirname + "/../server/controllers/additional-sheet-parser");
var grnmapOutputWorkbookPath = __dirname + "/../test-files/spreadsheet-controller-test-files/" +
  "15-genes_28-edges_db5-MO-LK_Sigmoid_estimation_missing-values_output.xlsx";
var grnmapInputWorkbookPath = __dirname + "/../test-files/spreadsheet-controller-test-files/" +
    "15-genes_28-edges_db5-MO-LK_Sigmoid_estimation_missing-values.xlsx";

describe("additional-sheet-parser", function () {

    it("parses a GRNmap output workbook without throwing errors", function () {
        var workbook = xlsx.parse(grnmapOutputWorkbookPath);
        assert.doesNotThrow(function () {
            parseAdditionalSheets(workbook);
        });
    });

    it("parses a GRNmap input workbook without throwing errors", function () {
        var workbook = xlsx.parse(grnmapInputWorkbookPath);
        assert.doesNotThrow(function () {
            parseAdditionalSheets(workbook);
        });
    });

    it("handles missing data in _expression sheets", function () {
        var workbook = xlsx.parse(__dirname + "/../test-files/spreadsheet-controller-test-files/" +
        "log2_expression_with_missing_data.xlsx");
        var data = parseAdditionalSheets(workbook);
        assert(data,
            {"expression": {
                "wt_log2_expression": {
{'fraction_non_alphanumeric': 0.12774725274725274, 'fraction_numerical': 0.008241758241758242, 'mean_word_length': 3.460949464012251, 'pattern_counts': {'":': 4, '<': 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': '6799726', 'n_tokens_mistral': 907, 'n_tokens_neox': 866, 'n_words': 140}