<commit_before><link rel="import" href="./_testing.html">
<!--
<link rel="import" href="../lib/hakuneko/engine/loader.html">
<link rel="import" href="../lib/hakuneko/engine/base/connectors/batoto-cdn.html">
-->

<script>

    // wrap in scope to ensure declared variables/functions do not collide with other tests
    {
        let test = new TestCollection( 'Batoto-CDN Tests' );
        test.register( '_getMangaList' );
        test.register( '_getChapterList' );

        /*
        let batoto = new BatotoCDN();
        batoto._getMangaList( ( error, mangas ) => {
            Assert.equal( 1, 2, 'MEOW' );
            //console.log( error, mangas.length );
        } );
        */
        setTimeout( () => {
            let error = null;
            let mangas = {length: undefined};
            test.call( '_getMangaList', () => {
                Assert.equal( null, error, error.message );
                Assert.equal( 50, mangas.length, 'Invalid number of mangas from BatotoCDN' );
            });
        }, 1000 );

        setTimeout( () => {
            let error = new Error( 'E_SOCKETTIMEDOUT' );
            let chapters = {length: 27};
            test.call( '_getChapterList', () => {
                Assert.equal( null, error, error.message );
                Assert.equal( 27, chapters.length, 'Invalid number of chapters from BatotoCDN' );
            });
        }, 750 );
    }

</script><commit_msg>preparations for batoto testing functions<commit_after><link rel="import" href="./_testing.html">
<!--
<link rel="import" href="../lib/hakuneko/engine/loader.html">
<link rel="import" href="../lib/hakuneko/engine/base/connectors/batoto-cdn.html">
-->

<script>

    // wrap in scope to ensure declared variables/functions do not collide with other tests
    {
        let test = new TestCollection( 'Batoto-CDN Tests' );
        test.register( '_getMangaList' );
        test.register( '_getChapterList' );

        /*
        let batoto = new BatotoCDN();
        batoto._getMangaList( ( error, mangas ) => {
            Assert.equal( 1, 2, 'MEOW' );
            //console.log( error, mangas.length );
        } );
        */
        setTimeout( () => {
            let error = null;
            let mangas = {length: undefined};
            test.call( '_getMangaList', () => {
                Assert.equal( null, error, ( error ? error.message : '' ) );
                Assert.equal( 50, mangas.length, 'Invalid number of mangas from BatotoCDN' );
            });
        }, 1000 );

        setTimeout( () => {
            let error = new Error( 'E_SOCKETTIMEDOUT' );
            let chapters = {length: 27};
            test.call( '_getChapterList', () => {
                Assert.equal( null, error, ( error ? error.message : '' ));
                Assert.equal( 27, chapters.length, 'Invalid number of chapters from BatotoCDN' );
            });
        }, 750 );
    }

</script>
{'fraction_non_alphanumeric': 0.1511508072827207, 'fraction_numerical': 0.010305736860185504, 'mean_word_length': 1.9236947791164658, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 25, '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': '5302056', 'n_tokens_mistral': 901, 'n_tokens_neox': 840, 'n_words': 201}