yagudaev/winnipegjs

Automated Tests

Closed this issue · 3 comments

Hi,

Do we want to have automated tests? I'd like to add some, as a way of making an example of testing an express app for the winnipeg.js group, and a way for me to get better at writing them with your help.

Is it OK if I write them with mocha, chai and sinon? That's what I've been writing with for the past few weeks at work, but I can switch to a different toolset if you prefer.

I could write out one test, then we can collaborate on improvements and iterate on it until we're happy with what we have.

Thanks!

Personally, I feel this project is a good example of when not to write tests. It is a static site and not a lot can go wrong with it. It is not mission critical and tests just add complexity and slow things down.

There is nothing really interesting to test there either. The app doesn't have a database connection, no state, login system, etc.

I think it is much better to demonstrate how to test something more realistic. Like a shopping cart application with a database and use of external services, showing us how to mock and isolate tests.

Also when you say testing, do you mean integration testing or unit testing?

What to test and at what level is something I struggled with (still do at times). Around the start up community, the current wisdom speaks of integration testing at minimum. If you have time, other tests. This also helps focus on the customer instead of making tests just for machines (dhh has a good rant about this)

You will have to research the tools you use. I can only tell you in Rails what to use. Node is a lot more difficult. But I did use Mocha and loved it.

Cool! Thanks for sharing that. I think I might write some (expectedly
throwaway) tests to see whether we get further great conversation on the
topic going.

On Thu, Sep 18, 2014 at 9:29 PM, Michael Yagudaev notifications@github.com
wrote:

Personally, I feel this project is a good example of when not to write
tests. It is a static site and not a lot can go wrong with it. It is not
mission critical and tests just add complexity and slow things down.

There is nothing really interesting to test there either. The app doesn't
have a database connection, no state, login system, etc.

I think it is much better to demonstrate how to test something more
realistic. Like a shopping cart application with a database and use of
external services, showing us how to mock and isolate tests.

Also when you say testing, do you mean integration testing or unit testing?

What to test and at what level is something I struggled with (still do at
times). Around the start up community, the current wisdom speaks of
integration testing at minimum. If you have time, other tests. This also
helps focus on the customer instead of making tests just for machines (dhh
has a good rant about this https://www.youtube.com/watch?v=9LfmrkyP81M)

You will have to research the tools you use. I can only tell you in Rails
what to use. Node is a lot more difficult. But I did use Mocha and loved it.


Reply to this email directly or view it on GitHub
#22 (comment).

Actually...you know what I might not mind taking another "stab" at? That
social networking for devs platform we attempted in Ruby this year in
winnipeg...and we could continue the testing conversation there.

Check https://github.com/winnipegrb/winnivote for reference if you hadn't
heard of it.

Could we please create a Winnipeg.js organization on github, and start
that as a project there, and I get commit rights?

Thanks!

On Thu, Sep 18, 2014 at 9:33 PM, Dan Bernardic dan.bernardic@gmail.com
wrote:

Cool! Thanks for sharing that. I think I might write some (expectedly
throwaway) tests to see whether we get further great conversation on the
topic going.

On Thu, Sep 18, 2014 at 9:29 PM, Michael Yagudaev <
notifications@github.com> wrote:

Personally, I feel this project is a good example of when not to write
tests. It is a static site and not a lot can go wrong with it. It is not
mission critical and tests just add complexity and slow things down.

There is nothing really interesting to test there either. The app doesn't
have a database connection, no state, login system, etc.

I think it is much better to demonstrate how to test something more
realistic. Like a shopping cart application with a database and use of
external services, showing us how to mock and isolate tests.

Also when you say testing, do you mean integration testing or unit
testing?

What to test and at what level is something I struggled with (still do at
times). Around the start up community, the current wisdom speaks of
integration testing at minimum. If you have time, other tests. This also
helps focus on the customer instead of making tests just for machines (dhh
has a good rant about this https://www.youtube.com/watch?v=9LfmrkyP81M)

You will have to research the tools you use. I can only tell you in Rails
what to use. Node is a lot more difficult. But I did use Mocha and loved it.


Reply to this email directly or view it on GitHub
#22 (comment).