Coder Social home page Coder Social logo

Comments (6)

wardbell avatar wardbell commented on May 22, 2024

Good point about ng version dependency; will do.

Do I need to update sinon dependency or simply relax its version too in the same manner as Ng? What are the issues/tradeoffs from your point of view?

from bardjs.

nareshbhatia avatar nareshbhatia commented on May 22, 2024

I don't know how to relax the sinon dependency in bower.json - since it is picking up an explicit version (http://sinonjs.org/releases/sinon-1.12.1.js). I think at least update to latest version (1.15.3). It's working fine for me.

As a side note, I am wondering is there a reason why we are going the bower route for bardjs and sinon (I basically used gulp-patterns as my template). Since these are all test libraries, should we be using npm packages for everything? The gulp-patterns package.json file already pulls in sinon. So perhaps pull in bardjs also from there as well? I am pretty sure that karma uses the version of sinon from npm (see http://karma-runner.github.io/0.10/config/configuration-file.html)

from bardjs.

wardbell avatar wardbell commented on May 22, 2024

Sorry, I should have looked at what I was doing before I leaped. I just pushed 0.1.4 with the changes you recommended. The closest I could get to sinon v.1.15.3 was the following:

sinon": "http://sinonjs.org/releases/sinon-1.15.0.js"

because there is no "...1.15.3.js" as I write this.

The reason I support the bower route is that many folks (me included) like to run tests in the browser, not just with karma. Maybe that's not a good enough reason. I'm kind of confused about package practice and etiquette.

Please give the latest a try and let me know if I can close this issue or if I have more work to do.

Thanks for using bard!

from bardjs.

nareshbhatia avatar nareshbhatia commented on May 22, 2024

I did run into a conflict because my bower.json was loading sinon 1.15.3. However the good news is that sinon is now available as a bower package. So you should be able to take out the hard coded dependency and simply include the latest as a bower package. See below:

$ bower install sinon --save
bower sinon#*                   cached git://github.com/cjohansen/Sinon.JS.git#1.15.3
bower sinon#*                 validate 1.15.3 against git://github.com/cjohansen/Sinon.JS.git#*
bower sinon#~1.15.3            install sinon#1.15.3

from bardjs.

wardbell avatar wardbell commented on May 22, 2024

That does not work ... at least not for me. That fails to deliver a single sinon JavaScript file. Instead, it delivers sinon in pieces that are knitted together with node by sinon.js and its many require statements. This does not work in a browser environment.

See the discussion here and on github where the author says "you will have to use a pre-built version. You can either build it yourself or get a numbered version from http://sinonjs.org." (yes, the comment about AMD applies equally to running in the browser).

The latest single-file release of sinon.js is v.1.15.0 (see big blue button at top of http://sinonjs.org)

I think you'll be fine with Karma and installing bardjs with npm install bardjs. Sure it loads sinon into the bower_components directory, but you will never need it or use it if you're running tests with karma. Like many node packages, the bardjs npm install loads a ton of other crap that you don't need but then "no-biggie" because you're never deploying this anyway.

The inner bardjs/node_modules directory holds the latest release of sinon, in case you don't want to depend upon it yourself.

Please prove me wrong ... or adjust your bower.json accordingly.

from bardjs.

nareshbhatia avatar nareshbhatia commented on May 22, 2024

Hmmm, I see. So the way I resolved the issue is by removing the sinon dependency from my bower.json and simply let bardjs' dependency download it.

Funny thing is that even if I remove sinon from my bower_components folder, the tests still pass. I know that they are using the browser (chrome specifically). So either they are picking up sinon from node_modules or I am wrong about the tests running from the browser and using sinon! Any ideas?

from bardjs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.