Comments (6)
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.
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.
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.
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.
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.
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)
- Issue testing routes using bardjs
- Failed to instantiate module function fakeRouteProvider
- mockService cannot omit config HOT 2
- Mocking a Data Service
- Mock Data Undefined HOT 1
- Type error 'undefined' evaluating 'bard.appModule....' HOT 2
- How to test Controller with $scope? HOT 11
- ReferenceError: Can't find variable: getinjectargs HOT 1
- Unable to test using PhantomJS HOT 6
- Unit testing with ng-html2js and Bard.js possible
- Mock resolving promise
- add components (angular 1.5 ) option to bardjs HOT 3
- Missing plugin for ESLint HOT 8
- Compile errors with Bard + Typescript + Jasmine HOT 3
- Unable to install - "Not compatible with your operating system or architecture: [email protected]"
- How to test a service with mocked dependencies services HOT 1
- This repo needs a new caretaker
- Publish v0.1.10 to npm
- MockService Doesn't Work with Services Defined as an ES6 Class
- v
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bardjs.