<commit_before>
import { expect } from 'chai';
import transpile from 'xod-espruino/transpiler';
import exampleState from 'state';

describe('xod-espruino', () => {
  it('should transpile example initial state to kinda valid code', () => {
    const code = transpile(exampleState);
    expect(code).to.match(/var project = {.*};/);
  });
});
<commit_msg>test(runtime): stronger regression test<commit_after>
import thunk from 'redux-thunk';
import { createStore, applyMiddleware } from 'redux';
import { expect } from 'chai';

import Selectors from 'selectors';
import transpile from 'xod-espruino/transpiler';
import initialState from 'state';
import generateReducers from 'reducers';
import { addNode } from 'actions';

describe('xod-espruino', () => {
  it('should transpile example initial state to kinda valid code', () => {
    const store = createStore(generateReducers([1]), initialState, applyMiddleware(thunk));
    store.dispatch(addNode(1, {x: 100, y: 100}, 1));

    const projectJSON = Selectors.Project.getProjectJSON(store.getState());
    const project = JSON.parse(projectJSON);
    const code = transpile(project);
    expect(code).to.match(/var project = {.+};/);
  });
});

{'fraction_non_alphanumeric': 0.1533948030176027, 'fraction_numerical': 0.0075440067057837385, 'mean_word_length': 5.060913705583756, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '4105963', 'n_tokens_mistral': 380, 'n_tokens_neox': 362, 'n_words': 97}