Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 06 08:18

    depfu[bot] on update

    (compare)

  • Sep 06 08:18

    papandreou on master

    Update eslint-plugin-node to ve… Merge pull request #663 from un… (compare)

  • Sep 06 08:18
    papandreou closed #663
  • Sep 06 04:55
    depfu[bot] labeled #663
  • Sep 06 04:55
    depfu[bot] opened #663
  • Sep 06 04:45

    depfu[bot] on update

    Update eslint-plugin-node to ve… (compare)

  • Sep 05 23:07
    papandreou commented #658
  • Sep 05 23:07

    depfu[bot] on update

    (compare)

  • Sep 05 23:07

    papandreou on master

    Update karma-chrome-launcher to… Merge pull request #658 from un… (compare)

  • Sep 05 23:07
    papandreou closed #658
  • Sep 05 22:57

    papandreou on link-check

    (compare)

  • Sep 05 16:05
    depfu[bot] synchronize #658
  • Sep 05 16:05

    depfu[bot] on update

    Update karma-chrome-launcher to… (compare)

  • Sep 05 16:05
    depfu[bot] edited #658
  • Sep 05 16:05
    alexjeffburke commented #658
  • Sep 05 16:05

    alexjeffburke on master

    Add hyperlink to check link int… Add canonicalroot and skip know… Fix broken links and 2 more (compare)

  • Sep 05 16:05
    alexjeffburke closed #662
  • Aug 28 21:08
    alexjeffburke commented #662
  • Aug 28 20:30
    Munter commented #662
  • Aug 28 20:14

    depfu[bot] on update

    (compare)

Gert Sønderby
@gertsonderby
Still haven't figured out what causes my jest setup to malfunction so severely, but I will, one day!
Gert Sønderby
@gertsonderby
Hm, I know we had mention of a setting for where unexpected breaks lines in diffs, but I can't seem to find it. Do any of you fine folks remember what it is? I'm testing diff outputs on a plugin, and getting different output from jest depending on situation.
Gert Sønderby
@gertsonderby
I found something called unexpected.output.preferredWidth. (By recalling that it was used in unexpected-immutable.)
Andreas Lind
@papandreou
Yeah, that's exactly it. It defaults to the detected width of your terminal, but in test suites it's handy to hardcode it: https://github.com/unexpectedjs/unexpected/blob/b049d34408bfa7b17350764a1b76474d54f4de0b/bootstrap-unexpected-markdown.js#L3
Gert Sønderby
@gertsonderby
I locked it to 80 and all my tests passed. So yup, seems that's the solution. :-)
Andreas Lind
@papandreou
:tada:
Sune Simonsen
@sunesimonsen

@papandreou or @Munter do you know of one of more npm packages that has the following information:

All valid html tags, valid children for a tag, valid attributes for a tag.

Sune Simonsen
@sunesimonsen
Andreas Lind
@papandreou
Yeah, it does. I was going to suggest looking for an HTML validator package, but there you go :)
Sune Simonsen
@sunesimonsen
I have a pretty interesting html generation going based on it already.
It needs more work, but it is great not needing to encode all of the rules when you can get it for free.
Andreas Lind
@papandreou
Oh, with chance-generators?
Peter Müller
@Munter
I'm pretty sure react also has a whitelist somewhere so they can know which things are props and which things go into attributes
Sune Simonsen
@sunesimonsen
@papandreou yes
The goal is a shribkable html5 generator.
Sune Simonsen
@sunesimonsen
The element order is a bit challenging, but I think I have a plan :-)
Andreas Lind
@papandreou
That sounds awesome, we could use that in the subfont tests
Sune Simonsen
@sunesimonsen
It will generate some pretty weird things, so "maybe"
I guess src attributes needs to be valid.
Andreas Lind
@papandreou
That’s perfect 🤗
We’ll also need to generate random CSS to fully exercise it.
Sune Simonsen
@sunesimonsen
Current kind of structure (very much work in progress:
{
        type: "tag",
        tag: "code",
        children: [
          {
            type: "tag",
            tag: "b",
            children: [{ type: "text", value: "Jizogu ohijoow ru." }],
            attributes: { hidden: "", dir: "auto" }
          },
          {
            type: "tag",
            tag: "time",
            children: [
              { type: "text", value: "Nibel uhu bebah demzef." },
              {
                type: "tag",
                tag: "img",
                children: [],
                attributes: {
                  contenteditable: "",
                  decoding: "auto",
                  src: "[)M0xd6",
                  dir: "ltr"
                }
              }
            ],
            attributes: {
              tabindex: "-191",
              contenteditable: "",
              hidden: "",
              draggable: "true"
            }
          },
          {
            type: "tag",
            tag: "button",
            children: [],
            attributes: {
              contenteditable: "false",
              dir: "auto",
              type: "reset",
              autofocus: "",
              hidden: ""
            }
          },
          { type: "text", value: "He waoho womtoce fobe ca ez nazinef." },
          {
            type: "tag",
            tag: "sub",
            children: [],
            attributes: { dir: "auto", contenteditable: "", tabindex: "-261" }
          }
        ],
        attributes: { tabindex: "-780", hidden: "", draggable: "false" }
      }
Andreas Lind
@papandreou
😍
Sune Simonsen
@sunesimonsen

We’ll also need to generate random CSS to fully exercise it.

That would also be cool, let's see.

First I need to support content order, required elements and attributes and excluded children :-)
Andreas Lind
@papandreou
Looking forward to see what you come up with :)
Sune Simonsen
@sunesimonsen
The fun thing is that I can use the html-validate package, to also validate that I'm creating something that is correct.
But it is probably going to be pretty brutal :-)
Andreas Lind
@papandreou
Hahaha :)
Sune Simonsen
@sunesimonsen
I'm using unexpected-snapshot to capture the output - it is awesome!
Andreas Lind
@papandreou
Fantastic :)
Peter Müller
@Munter
That is indeed some weird HTML right there :)
Andreas Lind
@papandreou
@Munter, He waoho womtoce fobe ca ez nazinef?
Peter Müller
@Munter
Yeah... Not sure what that means. But I'm going to put a tabindex of -261 on it :)
Andreas Lind
@papandreou
Yeah, that ought to take care of it :)
Peter Müller
@Munter
@sunesimonsen For readability of the output it might be easier on the eyes if the attributes ordered before the children array
Sune Simonsen
@sunesimonsen
This is just some kind of intermediate format.
Andreas Lind
@papandreou
It also seems like "easy on the eyes" is a non-goal of this markup :laughing:
Sune Simonsen
@sunesimonsen
I think I'll make generators that is compatible with the html5 parser package and also make the stringified version.
Alex J Burke
@alexjeffburke
that does look pretty neat :D
Alex J Burke
@alexjeffburke
I had this crazy idea at some point of being able to use chance-generators inside -express/-mitm to be able to kind of fuzz test HTTP - it's sort of reminiscent pf what you're doing there because one you have a DSL for something it seems to open itself to those kinds of opportunities
Sune Simonsen
@sunesimonsen
Fuzz testing is always fun :-)
Sune Simonsen
@sunesimonsen
I think I got the element order working now - one of the harder pieces of code I have written. Hope you enjoy the party, wish I could be there.
Sune Simonsen
@sunesimonsen
@/all I'm considering breaking backwards compatibility for react-dom-testing and unexpected-reaction by always adding a root div. I have seen a lot of confusion about components that render a new root element and you reference being stale, another issue is rendering fragments, that returns null as firstChild and therefore doesn't work. Any objections to make this change? You know that I don't take breaking backwards compatibility lightly.
Alex J Burke
@alexjeffburke
@sunesimonsen it's interesting that you started considering that - as it happens, we already run with a small wrapper when rendering components because we hit cases where assuming a DIV broke things (like you want to test a table row that must be inside a TABLE). Question though, how does this play as a series of assertions in unexpected-react? I'm thikning of the assertions that currently allow <ReactElement> on the right hand side
Sune Simonsen
@sunesimonsen
@alexjeffburke good point, unexpected-reaction would have to unwrap that on the right hand side. Thanks for mentioning it.
But that shouldn't be a problem.
Alex J Burke
@alexjeffburke
@sunesimonsen pleasure :) yeah I saw all those bits, will have a look during the day tomorrow