ipfs-deploy icon indicating copy to clipboard operation
ipfs-deploy copied to clipboard

Write end-to-end tests

Open agentofuser opened this issue 6 years ago • 3 comments

I don't have much experience testing JS, so suggestions of tools and practices are welcome.

agentofuser avatar May 03 '19 01:05 agentofuser

Strongly agree! I suggest ava - https://github.com/avajs/ava

it'd be great to split out the internals into small, tested functions, and split out the interface as per #7

I'm keen to help, so please do assign me on issues you are happy to for me to work on. If I can't do it'll i'll just let you know! I don't want to take any jobs that you're keen to do... for example, i'd love to try out pastel for #7 but I think that might be a fun job.

olizilla avatar May 03 '19 09:05 olizilla

I'm keen to help, so please do assign me on issues you are happy to for me to work on. If I can't do it'll i'll just let you know!

That's awesome! I like the speculative-assignment protocol :) Also, really appreciate your generosity 🙏

Strongly agree! I suggest ava - https://github.com/avajs/ava

Seems like a good choice! At this point I feel like Sindre Sorhus is basically writing my code for me.

it'd be great to split out the internals into small, tested functions, and split out the interface as per #7

Yeah, I want to split things as much as possible into:

  • pure total functions
  • effectful functions
  • pure UI

It seems like ava works for all of these.

Pastel uses ava, and there's also an example of blackbox-testing a CLI with ava: https://github.com/sindresorhus/active-win-cli/blob/d01813762b304102d1fee147855481e9f38c8517/test.js#L5-L6.

I think it's easier to keep things in JS rather than use something like bats, as my bash-fu is pretty limited and also JS works in more environments (#17).

I don't want to take any jobs that you're keen to do... for example, i'd love to try out pastel for #7 but I think that might be a fun job.

That's very considerate :) Yeah, in general I prefer focusing on UX, so I'm very much looking forward to familiarizing myself with pastel and ink.

agentofuser avatar May 03 '19 17:05 agentofuser

Oh, and as for the splitting, I think we can start with the extremities first, doing PTF (pure total function) and 100%-blackbox testing, then work our way to the middle with more granular testing for effectful functions.

agentofuser avatar May 03 '19 17:05 agentofuser