<commit_before>'use strict';

var assert = require('chai').assert,
    app = require('./testApp');

describe('app serialization', function () {
    it('can be constructed by undefined', function (done) {
        done();
    });
});<commit_msg>add more test for serialize<commit_after>'use strict';

var assert = require('chai').assert,
    app = require('./testApp');

describe('app serialization', function () {
    it('store status will be updated in app', function (done) {
        var App = new app();

        App.getStore('sampleStore').set('a', 9, true);
        assert.equal('{"stores":{"sampleStore":{"a":9}}}', App.toString());
        done();
    });

    it('store can be restored in app', function (done) {
        var App = new app({"stores":{"sampleStore":{"a":99}}});

        assert.equal(99, App.getStore('sampleStore').get('a'));
        done();
    });
});
{'fraction_non_alphanumeric': 0.20205479452054795, 'fraction_numerical': 0.00684931506849315, 'mean_word_length': 3.407035175879397, 'pattern_counts': {'":': 6, '<': 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': '6682121', 'n_tokens_mistral': 265, 'n_tokens_neox': 252, 'n_words': 66}