Have simple step by step in "getting start" page

86 views
Skip to first unread message

Juan LS

unread,
Apr 24, 2013, 12:36:00 PM4/24/13
to sin...@googlegroups.com
I am a refresh to Sinonjs and many javascript knowledges. When I plan start to use sinonjs with "Getting start" page, I couldn't get any clue about how to start from there.

After did some more research, cost me 4 hours, I found many necessary information missing in the "Getting start" page. After I setup the environment correct, things get better.

So I think it would be better if can provide simple step by step in "get start" page. And give more specified information about what is the approach in the "get start" page to use sinonjs.

Here is something I think would be useful to new comers:
  1. The approach run the test on "Get start" page is nodejs stand-alone way.
  2. The Prerequisites npm package including:
    1. Nodejs
    2. $ npm i sinonjs
    3. $ npm i mocha
    4. $ npm i chai
  3. The required module to run the test
    1. var assert = require("chai").assert
    2. var sinon = require('sinon');
  4. Then run test with
    1. $ mocha testfile.js


Regards,
Juan

Travis Kaufman

unread,
Apr 24, 2013, 1:11:24 PM4/24/13
to sin...@googlegroups.com
The github page has information about installing Sinon with NPM, but perhaps the Getting Started page could use a quick one-liner about installation.

Re your other steps, the page seems to be tailored more towards how to use Sinon itself than how to integrate it into the rest of your codebase, which IMO I believe is more appropriate. It assumes that you know how to install node modules and have a testing environment set up that you would like to include Sinon in.

However there are numerous tutorials throughout the interwebs regarding testing in  Node. Check this one out:
I believe It covers a lot of what you were looking for.
--
You received this message because you are subscribed to the Google Groups "Sinon.JS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sinonjs+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 


--
Travis Kaufman
travis....@gmail.com

Christian Johansen

unread,
Apr 25, 2013, 1:42:45 AM4/25/13
to sin...@googlegroups.com
Thanks for you input, Travis.

While there is good information many places, I do agree that we need a
"getting started" on sinonjs.org. I've had feedback from many sources
that it's too hard to get up and running with Sinon when you've never
used it before.

Juan's list is a good place to start, but I'd like to have a quick start
guide that covers the basics. I think the most common ways of using
Sinon is:

* Download and test in the browser - here we need info on what to
download and include in your test (explain the -ie files)
* npm install and test on node - quick example of how to require etc
* npm install and use in browser - this option is easy to fail, because
sinon/lib/sinon.js does not contain the entire library.

Additionally, I'd love it if we had a guide tailored to specific test
frameworks on sinonjs.org:

* Using Sinon.JS with Jasmine
* Using Sinon.JS with Buster.JS
* Using Sinon.JS with JsTestDriver
* Using Sinon.JS with QUnit
* Using Sinon.JS with Mocha
* Sinon.JS asserts for Chai
* Sinon.JS asserts for Referee

Etc.

If anyone wants to take a stab a starting this project, feel free to
send a pull request to http://github.com/cjohansen/sinon-web

Christian

Travis Kaufman writes:

> The github page has information about installing Sinon with NPM, but
> perhaps the Getting Started page could use a quick one-liner about
> installation.
>
> Re your other steps, the page seems to be tailored more towards how to use
> Sinon itself than how to integrate it into the rest of your codebase, which
> IMO I believe is more appropriate. It assumes that you know how to install
> node modules and have a testing environment set up that you would like to
> include Sinon in.
>
> However there are numerous tutorials throughout the interwebs regarding
> testing in Node. Check this one out:
> http://rosenfeld.herokuapp.com/en/articles/programming/2011-10-05-testing-javascript-with-node-jasmine-and-sinon
> I believe It covers a lot of what you were looking for.
>
> On Wednesday, April 24, 2013, Juan LS wrote:
>
>> I am a refresh to Sinonjs and many javascript knowledges. When I plan
>> start to use sinonjs with "Getting start" page, I couldn't get any clue
>> about how to start from there.
>>
>> After did some more research, cost me 4 hours, I found many necessary
>> information missing in the "Getting start" page. After I setup the
>> environment correct, things get better.
>>
>> So I think it would be better if can provide simple step by step in "get
>> start" page. And give more specified information about what is the approach
>> in the "get start" page to use sinonjs.
>>
>> Here is something I think would be useful to new comers:
>>
>> 1. The approach run the test on "Get start" page is nodejs stand-alone
>> way.
>> 2. The Prerequisites npm package including:
>> 1. Nodejs
>> 2. $ npm i sinonjs
>> 3. $ npm i mocha
>> 4. $ npm i chai
>> 3. The required module to run the test
>> 1. var assert = require("chai").assert
>> 2. var sinon = require('sinon');
>> 4. Then run test with
>> 1. $ mocha testfile.js
>>
>>
>>
>> Regards,
>> Juan
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Sinon.JS" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to sinonjs+u...@googlegroups.com <javascript:_e({}, 'cvml',
>> 'sinonjs%2Bunsu...@googlegroups.com');>.
Reply all
Reply to author
Forward
0 new messages