addressalign-toparrow-leftarrow-leftarrow-right-10x10arrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscontroller-playcredit-cardcrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobe--smallglobegmailgooglegroupshelp-with-circleimageimagesinstagramFill 1languagelaunch-new-window--smalllight-bulblightning-boltlinklocation-pinlockm-swarmSearchmailmediummessagesminusmobilemoremuplabelShape 3 + Rectangle 1ShapeoutlookpersonJoin Group on CardStartprice-ribbonprintShapeShapeShapeShapeImported LayersImported LayersImported Layersshieldstar-shapestartickettrashtriangle-downtriangle-uptwitteruserwarningyahooyoutube

Re: [jsmn] JavaScript Unit Testing?

From: Will B.
Sent on: Wednesday, July 29, 2015, 9:28 AM
Indeed it does, Scott! Highly recommend anyone interested in JS testing come check it out :)

My thoughts on all of this are:

- Unit, integration, and end-to-end testing are all important parts of quality and safe, confident code delivery, in my opinion.
- Whether or not you're using JSPs shouldn't matter too much for unit testing
- There are lots of great options for all three types of tests
- You definitely don't need Sauce Labs to do good E2E testing internally, though it will take resources and buy-in that make options like Sauce very cost effective

If you're using JSPs, you may want to check out Geb, or use Groovy with your Selenium Web Driver code. We use Maven to run Cucumber scenarios with Groovy Selenium automation scripts here at Optum, it has its problems but its generally providing a lot of value. I'm working the JS teams into using Jasmine to unit test our Angular code, and exploring Protractor as an alternative to the Groovy so the JS devs don't have to learn another language (plus its a nice fit with Angular!). 

On Wed, Jul 29, 2015 at 9:13 AM Scott Silvi <[address removed]> wrote:
MidwestJS usually has a testing track. Probably some really interesting presentations. That's coming up here in August. Might be worth a checkout. 

Sent from space

On Jul 29, 2015, at 8:28 AM, robert tomb <[address removed]> wrote:

This is a great discussion. My team at ReachLocal is moving beyond their JS unit testing in Jasmine and doing integration testing in the browser for multiple browsers using Sauce Labs. We are still driving those integration tests with mocha+chai because it makes for very readable tests, but I would not call in-browser testing unit testing, even if it were driven by a classical nUnit framework.

The type of testing that's happening once you evaluate a JSP, serve it through an app server, and test it in a browser is crossing a lot of boundaries and creates a lot of complexity. Don't get me wrong, they are super important and should be run as frequently as is practical, but people in your organization will have certain expectations for unit tests. Tests like these may not meet unit testing expectations for speed, portability, durability, and setup overhead.

So many organizations are loathe to put time/effort into testing that I believe it's important to set expectation, which is all I'm recommending by not calling these unit tests. They can still be developer-driven (designed, written, executed) tests.

Anyway, there is a way to tunnel back to your behind-the-firewall services from Sauce (and other tools) if you can get permission, so don't write it off as a technical problem. If it's a policy problem, I understand (I may not agree with said policy, but I understand...).

If anyone is interested in meeting early for the next JSMN meeting, it would be good to grab a whiteboard at CoCo and talk testing. I agree that this could grow into an eventual presentation topic.

--rt


 -------- __@ 
 ----- _`\<,_ 
 ---- (*)/ (*)
 ~~~~~~~~~~~~~~
robert tomb
[address removed]
twitter: @bikeonastick
http://bikeonastick.blogspot.com/

On Tue, Jul 28, 2015 at 10:39 PM, CT Yeung <[address removed]> wrote:
Jeff, Chad,

Off the mark from discussion, I follow the angular recipe.  In Jenkins, Karma invokes jasmine unit tests for js and nunit for .net services.

CT

On Tue, Jul 28, 2015 at 6:52 PM, Cjad Elstad <[address removed]> wrote:

Unfortunately we cannot go outside our firewalls so SauceLabs is out. :(
I will see about putting together a presentaton, but not sure I can make the August meetup.

On Jul 28,[masked]:51 PM, "Jeff Conrad" <[address removed]> wrote:
Chad, we have a similar app framework (spring tiles jquery bootstrap backbone) and use qunit, junit, spock and Geb, selenium as well.  If you already have selenium it is similar to get your tests running in geb.  Geb allows you to run automated tests via Jenkins to saucelabs.com which gets you cloud testing across devices IE11 included.  I like having different startegies: unit level, functional, and regression tests like you mention but I'm also an advocate of stochastic testing to examine a variety of inputs.  I'd be interested in seeing a tech talk of demo if you're going to do one.

Sent from Yahoo Mail on Android


From:"Cjad Elstad" <[address removed]>
Date:Mon, Jul 27, 2015 at 18:28
Subject:Re: [jsmn] JavaScript Unit Testing?

I have an implementation that works well for our needs. Before we go full boat across our applications, I wanted to bounce it off others to see if there was a better, or more simplified approach.
In reading Testable JavaScript over the weekend, the author is implementing something very similar so I feel I am not far off a solid approach.
So here's an info dump on our implementation...

Our implementation for unit testing is:
QUnit scripts being injected in to our dynamic pages, Jenkins with Selenium Grid plugin as our test runner (opens browsers, logs in to app, navigates to pages and waits for textarea element to be populated, takes those results and creates XML files which Selenium sends to Jenkins and Jenkins automagically renders then on a Test Results page).
I have run YUITest, QUnit, and Mocha/Chai in this environment. - Mocha will not let me get JUnit results in a variable, only to the console, which is not useful and I cannot get both displayed and XML formats without writing my own logic off the 'suite end' event. I didn't feel like writing my own plugin for Mocha to do that and QUnit will display and allow me to save off the results easily.
The implementation handles the following types of tests: Unit, Functional, Integration, and by default Regression.

Here's our tech stack: Enterprise Java web app, Spring MVC, Apache Tiles, JSP's with JSTL's, YUI framework (switching to jQuery).

Our needs are:
1. Test in browser with all JSP's creating the pages. And web drivers often emulate browser functionality, but are not perfect.
2. Pre-commit testing - while developer is running code, tests should be able to run.
3. Post-commit/Post-deploy testing - after deploying to our enterprise development environment, test should be able to be run on demand.
4. #2 and #3 need to be the same set of scripts. Our skill-set is JavaScript for our front-end team.
5. We need to report out our unit tests to a web/wiki page or Jenkins for auditing.
6. Must run in IE11.

As far as do I have any code samples? Not right now, and my code is internal. I was thinking about creating a github or two sometime down the road which is also why I was checking to see if my solution is of value to the community.

Thoughts?
Hope this helps. Sorry for the long post.
-Chad

On Jul 27,[masked]:26 PM, "robert tomb" <[address removed]> wrote:
Chad:

Sorry, I don't know of any groups focused on JS unit testing, but unit testing would be great topic at this meetup! Do you have small, encapsulated bits of logic you want to test or are you looking for more of an integration test to see how your JS executes within the web page? Your mention of JSPs led me to think you're really looking for a way to test in browser, which probably means you have to have that servlet container running. (Which... in turn means a lot of sitting around waiting for things to start up.)

We should talk at the next meeting. I like to talk about the advantages and disadvantages of testing at various levels and how different architectures contribute to or resolve those problems.  :-)

--rt


 -------- __@ 
 ----- _`\<,_ 
 ---- (*)/ (*)
 ~~~~~~~~~~~~~~
robert tomb
[address removed]
twitter: @bikeonastick
http://bikeonastick.blogspot.com/


On Fri, Jul 24, 2015 at 10:35 PM, Cjad Elstad <[address removed]> wrote:

Anyone know of a good JS unit test group? In MN would be even better, but I'll take a good one anywhere.
I am looking to hear how others are handling JS unit testing with JSP's as well as hear what others are doing in a more enterprise space.
Thanks in advance,
-Chad





--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Cjad Elstad ([address removed]) from JavaScriptMN.
To learn more about Cjad Elstad, visit his/her member profile
To report this message or block the sender, please click here
Set my mailing list to email me As they are sent | In one daily email | Don't send me mailing list messages

Meetup, POB 4668 #37895 NY NY USA 10163 | [address removed]





--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by robert tomb ([address removed]) from JavaScriptMN.
To learn more about robert tomb, visit his/her member profile
To report this message or block the sender, please click here
Set my mailing list to email me As they are sent | In one daily email | Don't send me mailing list messages

Meetup, POB 4668 #37895 NY NY USA 10163 | [address removed]




--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Cjad Elstad ([address removed]) from JavaScriptMN.
To learn more about Cjad Elstad, visit his/her member profile
To report this message or block the sender, please click here
Set my mailing list to email me As they are sent | In one daily email | Don't send me mailing list messages

Meetup, POB 4668 #37895 NY NY USA 10163 | [address removed]




--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Jeff Conrad ([address removed]) from JavaScriptMN.
To learn more about Jeff Conrad, visit his/her member profile
To report this message or block the sender, please click here
Set my mailing list to email me As they are sent | In one daily email | Don't send me mailing list messages

Meetup, POB 4668 #37895 NY NY USA 10163 | [address removed]




--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Cjad Elstad ([address removed]) from JavaScriptMN.
To learn more about Cjad Elstad, visit his/her member profile
To report this message or block the sender, please click here
Set my mailing list to email me As they are sent | In one daily email | Don't send me mailing list messages

Meetup, POB 4668 #37895 NY NY USA 10163 | [address removed]





--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by CT Yeung ([address removed]) from JavaScriptMN.
To learn more about CT Yeung, visit his/her member profile
To report this message or block the sender, please click here
Set my mailing list to email me As they are sent | In one daily email | Don't send me mailing list messages

Meetup, POB 4668 #37895 NY NY USA 10163 | [address removed]





--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by robert tomb ([address removed]) from JavaScriptMN.
To learn more about robert tomb, visit his/her member profile
To report this message or block the sender, please click here
Set my mailing list to email me As they are sent | In one daily email | Don't send me mailing list messages

Meetup, POB 4668 #37895 NY NY USA 10163 | [address removed]




--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Scott Silvi ([address removed]) from JavaScriptMN.
To learn more about Scott Silvi, visit his/her member profile

To report this message or block the sender, please click here
Set my mailing list to email me As they are sent | In one daily email | Don't send me mailing list messages

Meetup, POB 4668 #37895 NY NY USA 10163 | [address removed]

People in this
group are also in: