<commit_before>casper.on('remote.message', function(message) {
    this.echo('Message: '+ JSON.stringify(message));
});

casper.on('page.error', function(message, trace) {
    this.echo('Page error: ' + message);
    this.echo(JSON.stringify(trace));
});

casper.on('page.initialized', function() {
    this.evaluate(polyfillObjectAssign);
    this.evaluate(polyfillFunctionBind);
    this.evaluate(polyfillArrayFind);
});<commit_msg>Add screenshots for when test timeouts fail<commit_after>casper.on('remote.message', function(message) {
    this.echo('Message: '+ JSON.stringify(message));
});

casper.on('page.error', function(message, trace) {
    this.echo('Page error: ' + message);
    this.echo(JSON.stringify(trace));
});

casper.options.onWaitTimeout = function() {
    this.capture(`screenshots/timeout-${Date.now()}.png`);
    this.test.fail('timed out wating (screenshot taken)');
}

casper.on('page.initialized', function() {
    this.evaluate(polyfillObjectAssign);
    this.evaluate(polyfillFunctionBind);
    this.evaluate(polyfillArrayFind);
});
{'fraction_non_alphanumeric': 0.17591721542803387, 'fraction_numerical': 0.0, 'mean_word_length': 5.487804878048781, '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': '4116768', 'n_tokens_mistral': 341, 'n_tokens_neox': 333, 'n_words': 46}