Comments (8)
Put a breakpoint at the top and check to see if sinon
exists. If it doesn't, you're doing something wrong.
Expecting karma framework config to be something like this:
frameworks: ['mocha', 'chai', 'sinon', 'chai-sinon'],
Shouldn't be in karma config files section. Maybe that is the problem.
Look again at the bardjs readme. If it isn't clear enough, please make a suggested improvement in a PR.
from bardjs.
Yep, I have the frameworks setup identically to what is in the readme. Though I had to add karma-sinon (and karma-chai-sinon) via npm...otherwise it would give me an error.
Sinon is undefined though so definitely not being injected somehow. Yours and John's Play by Play was great, but I'm ready for the entire Testing (deep dive) training series John keeps threatening. ;-)
from bardjs.
Actually I was wrong, sinon is an object when I set a breakpoint at the top of the spec.
from bardjs.
Thanks to this article I found the issue. I needed to change my sinon bower dependency to point to the release file. Seems a bit odd that one would need to do that, but it seems to have fixed the issue. Now onto the next issue. :)
from bardjs.
How can we give the appropriate guidance in the bardjs readme? Propose something. I take PRs :-)
from bardjs.
Since I'm a newbie in this space I would first like to verify that my implementation is required, then I can absolutely do a PR. Can you verify that your reference to sinon in your bower.json file looks like:
"sinon": "http://sinonjs.org/releases/sinon-1.9.0.js"
rather than:
"sinon": "^1.14.1",
I'm guessing the other variable at play here is how we put together our tests (i.e., karma.config.js) via Grunt, Gulp or similar.
from bardjs.
Actually I just updated (v.0.1.4) the sinon to the most recent version by request (see issue #8 ).
sinon": "http://sinonjs.org/releases/sinon-1.15.0.js"
And, yes, I have to do it this way because there is no official bower package for sinon
Someone is trying to maintain a sinon bower package independently (sinonjs) ... I believe that is the package to which you refer. But his is not "official" and it's several releases behind right now. I'm tempted but am not quite comfortable ... yet.
from bardjs.
Closing because I have not heard from you and have no reason to believe there is a problem for me to fix. Happy to reopen if you think I should
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.