PS on the design part: to put it simply, tests should be run after main() 
worked. Other 80+ alerts are for the Macros.js tests, and if I put

formatter = new Formatter(config.formatters);

after

module("Macros.js", {});

both alerts are removed and tests 34-60 are passed. Though it doesn't mean 
all of the alerts were there because of Macros.js tests since in this case 
I don't set formatter back to null (seemingly I have to set and unset 
formatter in each test separately to do that).

Other tests however need separate consideration (32, 33 for loading/saving; 
66 for readMacroParams should be updated for the new version 
<https://github.com/YakovL/tiddlywiki/tree/YLTW>, 76 should be updated, 
too, for extended slices).

I have some additional questions:

? TiddlyWiki/test/README says there are JSSpec tests, but I don't see them. 
Were they removed? Should README be updated?

? what is a .recipe file? How they are ~concatenated? Some of them contain 
only tiddler or recipe commands (sounds like "include one recipe into 
another) while others various commands like
template, copyright, style, noscript, jsext (TiddlyWiki/html/split.recipe)
prehead, shadow (TiddlyWiki/shadows/split.recipe)
version, js (TiddlyWiki/js/split.recipe)
jsdeprecated (TiddlyWiki/deprecated/split.recipe)
jslib, jquery (TiddlyWiki/jquery/split.recipe, 
TiddlyWiki/jquery/plugins/split.recipe)
a whole zoo of them. Is there some docs/group threads with their 
description?

? (for now, just out of curiosity) does TW5 use some unit-tests system? 
Which one?

Best regards,
Yakov.

вторник, 2 января 2018 г., 0:02:37 UTC+3 пользователь Yakov написал:
>
> Hi guys, happy new year :)
>
> I've successfully modified a couple of tests and will make a pull request 
> once I build a complete set of tests for extended slices, now I think I can 
> become a maintainer, although there's a number things to learn still (most 
> notably, how to update classic.tiddlywiki.com once a new version is 
> ready). Jeremy, let me know how should I proceed for this.
>
> Another thing to note is I've found a probable source of those multiple 
> TypeError: 
> Cannot read property 'formatterRegExp' of null errors when tests.html is 
> opened. Since I've faced this error before in a plugin where the problem 
> was formatter is built before plugins are loaded and the plugin used 
> getPageTitle, I've suspected tests are launched before main – and it 
> looks so: first, the accepted answer at [1] suggests that window.onload 
> (which, as [2] suggests, is the same as <body onload=...>) fires later 
> than jQuery(document).ready(..); second, if (in tests.html) in
>
> test("generateRss: feed for an empty store", function() {
>
> I put
>
>         alert('1');
>         alert(formatter);
>         var rss = generateRss();
>         alert('2');
>
> instead of just var rss = generateRss();, I see the '1' alert before all 
> of those error alerts, second alert indicates that formatter is actually 
> null, then 5 of those errors are shown and then goes '2'.
>
> It is tempting to use the same hack I've used in the plugin I've mentioned 
> before: substitute
>
> problematicFunctionThatNeedsFormatterToBeBuilt();
>
> with
>
> formatter = new Formatter(config.formatters);
> problematicFunctionThatNeedsFormatterToBeBuilt();
> formatter = null;
>
> but I'm not sure yet if that can trick some tests and it feels like there 
> should be a more consistent approach to this. Any suggestions? By the way, 
> if I extend the example above like this:
>
>         alert('1');
>         var formatterCash = formatter;
>         formatter = new Formatter(config.formatters);
>         var rss = generateRss();
>         formatter = formatterCash;
>         alert('2');
>
> all error messages between '1' and '2' alerts go away and all the "3. 
> GenerateRss" tests are passed.
>
> Best regards,
> Yakov.
>
> [1] https://stackoverflow.com/a/3698214/3995261
> [2] https://stackoverflow.com/a/191318/3995261
>
> среда, 27 декабря 2017 г., 18:52:15 UTC+3 пользователь Yakov написал:
>>
>> Hi Jeremy,
>>
>> I wanted to write once I manage to correct at least one test and be ready 
>> to become a maintainer of TWc, but as a short note: yeap, now building 
>> works somewhat as expected and I also made a pull request to the 
>> tiddlywiki.com repo [1] to clarify the docs (I'll make some more 
>> suggestions later, the description definitely should be refactored to 
>> simplify the process for beginners).
>>
>> Best regards,
>> Yakov.
>>
>> [1] https://github.com/TiddlyWiki/tiddlywiki.com/pull/29
>>
>> вторник, 19 декабря 2017 г., 1:52:32 UTC+3 пользователь Jeremy Ruston 
>> написал:
>>>
>>> Hi Tobias
>>>
>>> Was there a particular necessity why the TWC build process involves 
>>> recipes and also phantom.js?
>>>
>>>
>>> The recipe files have been part of the TWC build process since 2005; 
>>> they're implemented in TW5 via the "classictools” plugin.
>>>
>>> We integrated Phantom.js sometime between 4 and 8 years ago. The final 
>>> stage of the build process is to run TWC under Phantom.js in order to 
>>> generate the index.xml RSS file.
>>>
>>> Best wishes
>>>
>>> Jeremy
>>>
>>>
>>> Especially the former appear to complicate things a lot and make it 
>>> somewhat less intuitive to build custom wikis.
>>>
>>> best -tb
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "TiddlyWikiDev" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to tiddlywikide...@googlegroups.com.
>>> To post to this group, send email to tiddly...@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/tiddlywikidev.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/tiddlywikidev/d48692bc-a6d1-4fd2-b5d1-9fbef95657ef%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/tiddlywikidev/d48692bc-a6d1-4fd2-b5d1-9fbef95657ef%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/60b68cac-b958-4162-abe7-296b616209a8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to