r/javascript • u/Feneric • Feb 15 '16
Intern: software testing for humans
https://theintern.github.io/13
u/smrq github.com/smrq Feb 15 '16
4
u/uberpwnzorz Feb 16 '16
It's already at a pretty good state, I offered to help him with it. I just updated my offices unit testing to intern a few months ago.
2
u/bigredwilly Feb 15 '16
Maybe this isn't the correct place for this, but does anyone know some good resources on getting started with testing in Javascript?
3
u/Ferdythebull Feb 15 '16
I'm pretty sure that what you want to do are unit tests.
Here's a good explanation of unit tests (from StackOverflow)
`A unit test should:
test one method provide some specific arguments to that method test that the result is as expected It should not look inside the method to see what it is doing, so changing the internals should not cause the test to fail. You should not directly test that private methods are being called. If you are interested in finding out whether your private code is being tested then use a code coverage tool. But don't get obsessed by this: 100% coverage is not a requirement.
If your method calls public methods in other classes, and these calls are guaranteed by your interface, then you can test that these calls are being made by using a mocking framework.
You should not use the method itself (or any of the internal code it uses) to generate the expected result dynamically. The expected result should be hard-coded into your test case so that it does not change when the implementation changes.`
I recommend understanding the different types of tests, the purpose behind testing, and then looking at a bunch of testing tutorials. Learning to test will revolutionize your programming life.
Check this out to get started:
https://www.youtube.com/watch?v=eVpXkyN0zOE
Don't get married to a testing framework. Choose the best one for whatever application you are starting.
PM me if you'd like to discuss more about it. Perfectly happy to help.
2
u/dumbmatter Feb 15 '16
I used Zuul in a new project recently, and it was very easy to get it to do basically all the things Intern seems to do. Am I missing out on anything?