Hi All, Looking for some suggestions on JS testing and profiling frameworks. So far I am leaning towards YUI but would be interested to hear other suggestions/views. Testing Framework The testing framework needs a way for me to hook into our continuous builds and fail the build if there are errors. There are obviously many different ways this could be achieved so I am open to all. Profiling This is something that we would want the ability to run in both development and optionally in production. Our applications are very javascript intensive and it would be great for us to be able to gather stats from the JS running on a client machine. e.g. I am hoping to have the ability to switch profiling on and off when I want with the results returned to a web service or the like. Thanks in advance for your comments and suggestions. Cheers, Simon ********************************************************************************************** Important Note This email (including any attachments) contains information which is confidential and may be subject to legal privilege. If you are not the intended recipient you must not use, distribute or copy this email. If you have received this email in error please notify the sender immediately and delete this email. Any views expressed in this email are not necessarily the views of IRESS Market Technology Limited. It is the duty of the recipient to virus scan and otherwise test the information provided before loading onto any computer system. IRESS Market Technology Limited does not warrant that the information is free of a virus or any other defect or error. **********************************************************************************************
Hey Simon, It depends on whether or you want to be testing server-side or client-side. To test and profile server-side that'll be pretty easy to cancel your build process. There's a whole bunch of node.js solutions out there - https://github.com/joyent/node/wiki/modules#testing and I've already tried Vows and Expresso, and went with Expresso as it was much more straightforward to use than Vows and still supports asynchronous testing. JSHint - http://jshint.com/ - is also available in node, and I've used that successfully with a node.js build process to abort the build if jshint fails. Not sure about the non node.js tools though. For client side testing QUnit and TestSwarm can be pretty powerful, as TestSwarm crowd-sources the testing process which is pretty nifty. This is the approach jquery uses - http://swarm.jquery.org/ - http://docs.jquery.com/Qunit - but for integrating with your build process, not sure how you would do this. Hope that helps :) -- Benjamin Arthur Lupton Courageous Web 2.0 Architect, Entrepreneur. Creator of History.js (https://github.com/balupton/history.js), DocPad (https://github.com/balupton/docpad), and NowPad (https://github.com/balupton/nowpad). http://balupton.com (http://balupton.com/) | b@lupton.cc (mailto:b@lupton.cc) | skype balupton | tweet @balupton (http://twitter.com/balupton) On Friday, 15 July 2011 at 2:44 PM, Simon Weston wrote: > Hi All, > > Looking for some suggestions on JS testing and profiling frameworks. So far I am leaning towards YUI but would be interested to hear other suggestions/views. > > Testing Framework > The testing framework needs a way for me to hook into our con tinuous builds and fail the build if there are errors. There are obviously many different ways this could be achieved so I am open to all. > > Profiling > This is something that we would want the ability to run in both development and optionally in production. > > Our applications are very javascript intensive and it would be great for us to be able to gather stats from the JS running on a client machine. e.g. I am hoping to have the ability to switch profil ing on and off when I want with the results returned to a web service or the like. > > > Thanks in advance for your comments and suggestions. > > Cheers, > > Simon > > **************************************************************************************** ****** > Important Note > This email (including any attachments) contains information which is confidential and may be subject to legal privilege. If you are not the intended recipient you must not use, distribute or copy this email. If you have received this email in error please notify the > sender immediately and delete this email. Any views expressed in this email are not necessarily the views of IRESS Market Technology Limited. > > It is the duty of the recipient to virus scan and otherwise test the information provided before loading onto any computer system. > IRESS Market Technology Limited does not warrant that the information is free of a virus or any other defect or error. > **********************************************************************************************
For both client/server testing there is also the jasmine library from pivotal. https://github.com/pivotal/jasmine On Fri, Jul 15, 2011 at 3:36 PM, Benjamin Lupton <b@lupton.cc> wrote: > Hey Simon, > It depends on whether or you want to be testing server-side or client-side. > To test and profile server-side that'll be pretty easy to cancel your build > process. There's a whole bunch of node.js solutions out there > - https://github.com/joyent/node/wiki/modules#testing and I've already tried > Vows and Expresso, and went with Expresso as it was much more > straightforward to use than Vows and still supports asynchronous testing. > JSHint - http://jshint.com/ - is also available in node, and I've used that > successfully with a node.js build process to abort the build if jshint > fails. Not sure about the non node.js tools though. > For client side testing QUnit and TestSwarm can be pretty p owerful, as > TestSwarm crowd-sources the testing process which is pretty nifty. This is > the approach jquery uses > - http://swarm.jquery.org/ - http://docs.jquery.com/Qunit - but for > integrating with your build process, not sure how you would do this. > Hope that helps :) > > --< /span> > Benjamin Arthur Lupton > Courageous Web 2.0 Architect, Entrepreneur. > Creator of History.js, DocPad, and NowPad. > http://balupton.com | b@lupton.cc | skype balupton | tweet @balupton > > On Friday, 15 July 2011 at 2:44 PM, Simon Weston wrote: > > Hi All, > > > > Looking for some suggestions on JS testing and profiling frameworks. So far > I am leaning towards YUI but would be interested to hear other > suggestions/views. > > > > Testing Framework > > The testing framework needs a way for me to hook into our con tinuous builds > and fail the build if there are errors. There are obviously many different > ways this could be achieved so I am open to all. > > > > Profiling > > This is something that we would want the ability to run in both development > and optionally in production. > > > > Our applications are very javascript intensive and it would be great for us > to be able to gather stats from the JS running on a client machine. e.g. I > am hoping to have the ability to switch profil ing on and off when I want > with the results returned to a web service or the like. > > > > > > Thanks in advance for your comments and suggestions. > > > > Cheers, > > > > Simon > > **************************************************************************************** > ****** > Important Note > This email (including any attachments) contains information which is > confidential and may be subject to legal privilege. If you are not the > intended recipient you must not use, distribute or copy this email. If you > have received this email in error please notify the > sender immediately and delete this email. Any views expressed in this email > are not necessarily the views of IRESS Market Technology Limited. > > It is the duty of the recipient to virus scan and otherwise test the > information provided before loading onto any computer system. > IRESS Market Technology Limited does not warrant that the information is > free of a virus or any other defect or error. > ********************************************************************************************** > -- -barkmadley sent from an internet enabled device http://barkmadley.com
I also used Jasmine, switched to it from http://docs.jquery.com/Qunit. The functionality of both is near the same, jasmine's code looks more readable for me. On Fri, Jul 15, 2011 at 3:53 PM, Mark Bradley <barkmadley@gmail.com> wrote: > For both client/server testing there is also the jasmine library from > pivotal. https://github.com/pivotal/jasmine > > On Fri, Jul 15, 2011 at 3:36 PM, Benjamin Lupton <b@lupton.cc> wrote: >> Hey Simon, >> It depends on whether or you want to be testing server-side or client-side. >> To test and profile server-side that'll be pretty easy to cancel your build >> process. There's a whole bunch of node.js solutions out there >> - https://github.com/joyent/node/wiki/modules#testing and I've already tried >> Vows and Expresso, and went with Expresso as it was much more >> straightforward to use than Vows and still supports asynchronous testing. >> JSHint - http://jshint.com/ - is also available in node, and I've used that >> successfully with a node.js build process to abort the build if jshint >> fails. Not sure about the non node.js tools though. >> For client side testing QUnit and TestSwarm can be pretty p owerful, as >> TestSwarm crowd-sources the testing process which is pretty nifty. This is >> the approach jquery uses >> - http://swarm.jquery.org/ - http://docs.jquery.com/Qunit - but for >> integrating with your build process, not sure how you would do this. >> Hope that helps :) >> >> --< /span> >> Benjamin Arthur Lupton >> Courageous Web 2.0 Architect, Entrepreneur. >> Creator of History.js, DocPad, and NowPad. >> http://balupton.com | b@lupton.cc | skype balupton | tweet @balupton >> >> On Friday, 15 July 2011 at 2:44 PM, Simon Weston wrote: >> >> Hi All, >> >> >> >> Looking for some suggestions on JS testing and profiling frameworks. So far >> I am leaning towards YUI but would be interested to hear other >> suggestions/views. >> >> >> >> Testing Framework >> >> The testing framework needs a way for me to hook into our con tinuous builds >> and fail the build if there are errors. There are obviously many different >> ways this could be achieved so I am open to all. >> >> >> >> Profiling >> >> This is something that we would want the ability to run in both development >> and optionally in production. >> >> >> >> Our applications are very javascript intensive and it would be great for us >> to be able to gather stats from the JS running on a client machine. e.g. I >> am hoping to have the ability to switch profil ing on and off when I want >> with the results returned to a web service or the like. >> >> >> >> >> >> Thanks in advance for your comments and suggestions. >> >> >> >> Cheers, >> >> >> >> Simon >> >> **************************************************************************************** >> ****** >> Important Note >> This email (including any attachments) contains information which is >> confidential and may be subject to legal privilege. If you are not the >> intended recipient you must not use, distribute or copy this email. If you >> have received this email in error please notify the >> sender immediately and delete this email. Any views expressed in this email >> are not necessarily the views of IRESS Market Technology Limited. >> >> It is the duty of the recipient to virus scan and otherwise test the >> information provided before loading onto any computer system. >> IRESS Market Technology Limited does not warrant that the information is >> free of a virus or any other defect or error. >> ********************************************************************************************** >> > > > > -- > -barkmadley > sent from an internet enabled device > http://barkmadley.com > -- Best Regards, Valery Yushchenko, Software Engineer e-mail: valery.yushchenko@gmail.com skype: valerii_yushchenko
I'm now using node-async-testing and cognac, which is/will be a port of node-async-testing to the browser. I can't share cognac just yet, as it's still a massive mess of hacks just so that we had a test runner while working on some new stuff at pusher.com. The major drawbacks to things like QUnit are: - every testing method is global, nothing is scoped to a specific test. - testing is assumed to be synchronous and random issues are introduced when you begin to try and do asynchronous testing. Example: I actually managed to start having tests leaking from one testcase to another, which isn't what you want at all. I should have something releasable of cognac in the next few weeks, but the testing API is exactly the same as that used in node-async-testing. – Micheil On 15 Jul 2011, at 07:05, Valery Yushchenko wrote: > I also used Jasmine, switched to it from http://docs.jquery.com/Qunit. > The functionality of both is near the same, jasmine's code looks more > readable for me. > > On Fri, Jul 15, 2011 at 3:53 PM, Mark Bradley <barkmadley@gmail.com> wrote: >> For both client/server testing there is also the jasmine library from >> pivotal. https://github.com/pivotal/jasmine >> >> On Fri, Jul 15, 2011 at 3:36 PM, Benjamin Lupton <b@lupton.cc> wrote: >>> Hey Simon, >>> It depends on whether or you want to be testing server-side or client-side. >>> To test and profile server-side that'll be pretty easy to cancel your build >>> process. There's a whole bunch of node.js solutions out there >>> - https://github.com/joyent/node/wiki/modules#testing and I've already tried >>> Vows and Expresso, and went with Expresso as it was much more >>> straightforward to use than Vows and still supports asynchronous testing. >>> JSHint - http://jshint.com/ - is also available in node, and I've used that >>> successfully with a node.js build process to abort the build if jshint >>> fails. Not sure about the non node.js tools though. >>> For client side testing QUnit and TestSwarm can be pretty p owerful, as >>> TestSwarm crowd-sources the testing process which is pretty nifty. This is >>> the approach jquery uses >>> - http://swarm.jquery.org/ - http://docs.jquery.com/Qunit - but for >>> integrating with your build process, not sure how you would do this. >>> Hope that helps :) >>> >>> --< /span> >>> Benjamin Arthur Lupton >>> Courageous Web 2.0 Architect, Entrepreneur. >>> Creator of History.js, DocPad, and NowPad. >>> http://balupton.com | b@lupton.cc | skype balupton | tweet @balupton >>> >>> On Friday, 15 July 2011 at 2:44 PM, Simon Weston wrote: >>> >>> Hi All, >>> >>> >>> >>> Looking for some suggestions on JS testing and profiling frameworks. So far >>> I am leaning towards YUI but would be interested to hear other >>> suggestions/views. >>> >>> >>> >>> Testing Framework >>> >>> The testing framework needs a way for me to hook into our con tinuous builds >>> and fail the build if there are errors. There are obviously many different >>> ways this could be achieved so I am open to all. >>> >>> >>> >>> Profiling >>> >>> This is something that we would want the ability to run in both development >>> and optionally in production. >>> >>> >>> >>> Our applications are very javascript intensive and it would be great for us >>> to be able to gather stats from the JS running on a client machine. e.g. I >>> am hoping to have the ability to switch profil ing on and off when I want >>> with the results returned to a web service or the like. >>> >>> >>> >>> >>> >>> Thanks in advance for your comments and suggestions. >>> >>> >>> >>> Cheers, >>> >>> >>> >>> Simon >>> >>> **************************************************************************************** >>> ****** >>> Important Note >>> This email (including any attachments) contains information which is >>> confidential and may be subject to legal privilege. If you are not the >>> intended recipient you must not use, distribute or copy this email. If you >>> have received this email in error please notify the >>> sender immediately and delete this email. Any views expressed in this email >>> are not necessarily the views of IRESS Market Technology Limited. >>> >>> It is the duty of the recipient to virus scan and otherwise test the >>> information provided before loading onto any computer system. >>> IRESS Market Technology Limited does not warrant that the information is >>> free of a virus or any other defect or error. >>> ********************************************************************************************** >>> >> >> >> >> -- >> -barkmadley >> sent from an internet enabled device >> http://barkmadley.com >> > > > > -- > Best Regards, > Valery Yushchenko, > Software Engineer > > e-mail: valery.yushchenko@gmail.com > skype: valerii_yushchenko
Ive been using QUnit + SinonJS for unit and integration testing in the browser. Sinon is awesome because it essentially allows you to reduce all asynchronous tasks (server calls and such) to synchronous ones -- it provides mocks, spies and other useful things to check the things you care about and ignore the rest. Using Sinon, I've been able to rewrite several of our Selenium tests to run entirely within JavaScript. I'd recommend giving it a look-in: http://sinonjs.org Sent from my iPhone On 15/07/2011, at 6:57 PM, Micheil Smith <micheil@brandedcode.com> wrote: > I'm now using node-async-testing and cognac, which is/will be a port of node-async-testing > to the browser. > > I can't share cognac just yet, as it's still a massive mess of hacks just so that we had a test > runner while working on some new stuff at pusher.com. > > The major drawbacks to things like QUnit are: > - every testing method is global, nothing is scoped to a specific test. > - testing is assumed to be synchronous and random issues are introduced when you begin > to try and do asynchronous testing. > > Example: I actually managed to start having tests leaking from one testcase to another, which > isn't what you want at all. > > I should have something releasable of cognac in the next few weeks, but the testing API is > exactly the same as that used in node-async-testing. > > – Micheil > > On 15 Jul 2011, at 07:05, Valery Yushchenko wrote: > >> I also used Jasmine, switched to it from http://docs.jquery.com/Qunit. >> The functionality of both is near the same, jasmine's code looks more >> readable for me. >> >> On Fri, Jul 15, 2011 at 3:53 PM, Mark Bradley <barkmadley@gmail.com> wrote: >>> For both client/server testing there is also the jasmine library from >>> pivotal. https://github.com/pivotal/jasmine >>> >>> On Fri, Jul 15, 2011 at 3:36 PM, Benjamin Lupton <b@lupton.cc> wrote: >>>> Hey Simon, >>>> It depends on whether or you want to be testing server-side or client-side. >>>> To test and profile server-side that'll be pretty easy to cancel your build >>>> process. There's a whole bunch of node.js solutions out there >>>> - https://github.com/joyent/node/wiki/modules#testing and I've already tried >>>> Vows and Expresso, and went with Expresso as it was much more >>>> straightforward to use than Vows and still supports asynchronous testing. >>>> JSHint - http://jshint.com/ - is also available in node, and I've used that >>>> successfully with a node.js build process to abort the build if jshint >>>> fails. Not sure about the non node.js tools though. >>>> For client side testing QUnit and TestSwarm can be pretty p owerful, as >>>> TestSwarm crowd-sources the testing process which is pretty nifty. This is >>>> the approach jquery uses >>>> - http://swarm.jquery.org/ - http://docs.jquery.com/Qunit - but for >>>> integrating with your build process, not sure how you would do this. >>>> Hope that helps :) >>>> >>>> --< /span> >>>> Benjamin Arthur Lupton >>>> Courageous Web 2.0 Architect, Entrepreneur. >>>> Creator of History.js, DocPad, and NowPad. >>>> http://balupton.com | b@lupton.cc | skype balupton | tweet @balupton >>>> >>>> On Friday, 15 July 2011 at 2:44 PM, Simon Weston wrote: >>>> >>>> Hi All, >>>> >>>> >>>> >>>> Looking for some suggestions on JS testing and profiling frameworks. So far >>>> I am leaning towards YUI but would be interested to hear other >>>> suggestions/views. >>>> >>>> >>>> >>>> Testing Framework >>>> >>>> The testing framework needs a way for me to hook into our con tinuous builds >>>> and fail the build if there are errors. There are obviously many different >>>> ways this could be achieved so I am open to all. >>>> >>>> >>>> >>>> Profiling >>>> >>>> This is something that we would want the ability to run in both development >>>> and optionally in production. >>>> >>>> >>>> >>>> Our applications are very javascript intensive and it would be great for us >>>> to be able to gather stats from the JS running on a client machine. e.g. I >>>> am hoping to have the ability to switch profil ing on and off when I want >>>> with the results returned to a web service or the like. >>>> >>>> >>>> >>>> >>>> >>>> Thanks in advance for your comments and suggestions. >>>> >>>> >>>> >>>> Cheers, >>>> >>>> >>>> >>>> Simon >>>> >>>> **************************************************************************************** >>>> ****** >>>> Important Note >>>> This email (including any attachments) contains information which is >>>> confidential and may be subject to legal privilege. If you are not the >>>> intended recipient you must not use, distribute or copy this email. If you >>>> have received this email in error please notify the >>>> sender immediately and delete this email. Any views expressed in this email >>>> are not necessarily the views of IRESS Market Technology Limited. >>>> >>>> It is the duty of the recipient to virus scan and otherwise test the >>>> information provided before loading onto any computer system. >>>> IRESS Market Technology Limited does not warrant that the information is >>>> free of a virus or any other defect or error. >>>> ********************************************************************************************** >>>> >>> >>> >>> >>> -- >>> -barkmadley >>> sent from an internet enabled device >>> http://barkmadley.com >>> >> >> >> >> -- >> Best Regards, >> Valery Yushchenko, >> Software Engineer >> >> e-mail: valery.yushchenko@gmail.com >> skype: valerii_yushchenko >