<commit_before>var _ = require("underscore");

var React = require("react");

var ReactDOM = require("react-dom");

var fixture;

var {
    beforeEach,
    notStrictEqual,
    strictEqual,
    xit,
} = global;

function translateScore(guessAndScore) {
    // Translate a guessAndScore from internal Perseus format to the
    // result format used everywhere else.
    //
    // TODO(eater): Use the existance of these unit tests to
    //              convert eveything to The One True Format.
    var guess = guessAndScore[0];
    var score = guessAndScore[1];
    if (score.type === "points") {
        return {
            empty: false,
            correct: score.earned >= score.total,
            message: score.message,
            guess: guess,
        };
    } else if (score.type === "invalid") {
        return {
            empty: true,
            correct: false,
            message: score.message,
            guess: guess,
        };
    }
}<commit_msg>Fix perseus test to not use babel-only features because it makes the tests break<commit_after>/* global beforeEach, notStrictEqual, strictEqual, xit */

var _ = require("underscore");
var React = require("react");
var ReactDOM = require("react-dom");

var fixture;

function translateScore(guessAndScore) {
    // Translate a guessAndScore from internal Perseus format to the
    // result format used everywhere else.
    //
    // TODO(eater): Use the existance of these unit tests to
    //              convert eveything to The One True Format.
    var guess = guessAndScore[0];
    var score = guessAndScore[1];
    if (score.type === "points") {
        return {
            empty: false,
            correct: score.earned >= score.total,
            message: score.message,
            guess: guess,
        };
    } else if (score.type === "invalid") {
        return {
            empty: true,
            correct: false,
            message: score.message,
            guess: guess,
        };
    }
}
{'fraction_non_alphanumeric': 0.10712481051035877, 'fraction_numerical': 0.00202122283981809, 'mean_word_length': 2.0414746543778803, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '750886', 'n_tokens_mistral': 548, 'n_tokens_neox': 547, 'n_words': 173}