<commit_before>/*
* This test should be executed in the file's path.
*/

var YUITest = require('yuitest').YUITest,
    Shaker = require('../../lib/core.js').ShakerCore,
    libfs = require('fs');
    libpath = require('path');

var Assert = YUITest.Assert;
var suite = new YUITest.TestSuite("Store API");


suite.add( new YUITest.TestCase({
        name: "Store integration",
                
        setUp : function () {
            var relRoot = 'fixtures/test_mojit_assets',
                root = libpath.join(__dirname, relRoot);
            this.shaker = new ShakerCore({root: root});
        },
        tearDown : function () {
            
        },
        'test components simple mojit': function () {
            var result = this.shaker.shakeMojitByContext('test_mojit_01', {}),
                assets = result.assets;
            Assert.isTrue(assets.length === 3);
        },
        'test action assets': function (){
            var result = this.shaker.shakeMojitByContext('test_mojit_02', {}),
                assets = result.assets;
            Assert.isTrue(assets.length === 3);
        },
        'test action assets dimension (device:iphone)': function () {
            var result = this.shaker.shakeMojitByContext('test_mojit_02', {device:'iphone'}),
                assets = result.assets;
                
            Assert.isTrue(assets.length === 3);
            Assert.isTrue(result.assets[0].source.fs.basename === 'base.iphone');
            Assert.isTrue(result.assets[2].source.fs.basename === 'poc');
            Assert.isNotUndefined(result.actions.index.assets);
            Assert.isTrue(result.actions.index.assets.length === 1);
            Assert.isTrue(result.actions.index.assets[0].source.fs.basename === 'index.iphone');
        }
       }));

YUITest.TestRunner.add(suite);<commit_msg>changed test in test_mojits_assets to take the new img file into account<commit_after>/*
* This test should be executed in the file's path.
*/

var YUITest = require('yuitest').YUITest,
    Shaker = require('../../lib/core.js').ShakerCore,
    libfs = require('fs');
    libpath = require('path');

var Assert = YUITest.Assert;
var suite = new YUITest.TestSuite("Store API");


suite.add( new YUITest.TestCase({
        name: "Store integration",

        setUp : function () {
            var relRoot = 'fixtures/test_mojit_assets',
                root = libpath.join(__dirname, relRoot);
            this.shaker = new ShakerCore({root: root});
        },
        tearDown : function () {

        },
        'test components simple mojit': function () {
            var result = this.shaker.shakeMojitByContext('test_mojit_01', {}),
                assets = result.assets;
            Assert.isTrue(assets.length === 3);
        },
        'test action assets': function (){
            var result = this.shaker.shakeMojitByContext('test_mojit_02', {}),
                assets = result.assets;
            Assert.isTrue(assets.length === 3);
        },
        'test action assets dimension (device:iphone)': function () {
            var result = this.shaker.shakeMojitByContext('test_mojit_02', {device:'iphone'}),
                assets = result.assets;
            // this.shaker.logger.dump(assets);
            Assert.isTrue(assets.length === 4);
            Assert.isTrue(result.assets[0].source.fs.basename === 'base.iphone');
            Assert.isTrue(result.assets[3].source.fs.basename === 'poc');
            // Assert.isNotUndefined(result.actions.index.assets);
            // Assert.isTrue(result.actions.index.assets.length === 1);
            // Assert.isTrue(result.actions.index.assets[0].source.fs.basename === 'index.iphone');
        }
       }));

YUITest.TestRunner.add(suite);
{'fraction_non_alphanumeric': 0.14557131388814556, 'fraction_numerical': 0.006957452502006957, 'mean_word_length': 2.2363636363636363, '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': '3685607', 'n_tokens_mistral': 1129, 'n_tokens_neox': 1092, 'n_words': 199}