Ad
  • Custom User Avatar

    Random tests aligned with changes in attributes type

  • Custom User Avatar

    Edited, now attributes is an object. I'll mark this suggestion as resolved as well as random tests

  • Custom User Avatar

    Ok, so we could transform the result in this form

    html([
        head([
            title(['Hello, world!']),
            script({
                type:'text/javascript',
                src:'js/index.js'
            }),
            link({
                rel:'stylesheet',
                href:'css/style.css'
            })
        ]),
        body([
            div({
                class:'this-is-a-class',
                id:'this-makes-me-unique'
            },['Hello, world!'])
        ])
    ])
    

    Where both attributes and content aren't required.
    I'll wait some feedback from you in order to make changes in Kata

  • Custom User Avatar

    Sorry for the delay. In fact there were some bugs in the random test procedure. I fixed them, now you shouldn't see anymore the attribute you describe and string content as well. I tested the results by searching for /\s\s/g, /\w\)/g and /\w\s\)/g and can't find this behaviour anymore.

  • Custom User Avatar

    Added attributes in random tests. Unfortunately they are random string so they can be non-valid format for an HTML validation but in terms of testing they are valid.

  • Custom User Avatar

    I added a table to describe element, now I will complete random tests with attriutes. Later I'll change the way attributes are written but, first of all, a good cigarette!

  • Custom User Avatar

    Excuse me, in fact inside the description I don't specify that content is an array, altought in the example it is shown, I'll edit this now. Function results are always string. For your second point content already is always an array. I will revise description to be more clear, thank you

  • Custom User Avatar

    It would be great, for javascript, to have an object to export and then require it in test cases. I have to think about it and how to update description. If you have some ideas about how to do it you're welcome!

  • Custom User Avatar

    Added random tests for elements and content, I'm working on attributes! :-)

  • Custom User Avatar

    Thank you! Hopefully, I will work on random tests today!

  • Custom User Avatar

    You're right, I thought of it once I completed the Kata for publication. However I'm a bit discussed about it because if some wants to add some logic in writing HTML this way it could be easier to store an attribute as a costant, let's say a class, and add it to an array instead of adding it as an object key..

  • Custom User Avatar

    I edited the description at the bottom so there should be no misunderstandings :-)

  • Custom User Avatar

    Yep! I just find code more clean by seeing the self closing tag. I will edit description however! Thank you!