Git Product home page Git Product logo

karma-sinon-chai's People

Contributors

bankyadam avatar bitdeli-chef avatar bricss avatar davidbarrows avatar elmariofredo avatar joscha avatar kevicency avatar lordnox avatar marian-r avatar merlinc avatar nfroidure avatar nicolasjacquemin avatar princed avatar sudo-suhas avatar tarjei avatar vinnymac avatar xdissent avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

karma-sinon-chai's Issues

No longer works with latest Sinon

The latest Sinon release has files in a different location and does no longer work with karma-sinon-chai.

Changing package.json from
"dependencies": {
"chai": "^1.10",
"sinon": "^1.12",
"sinon-chai": "^2.6",
"lodash": "^2.4.1"
},

to

"dependencies": {
"chai": "^1.10",
"sinon": "1.12",
"sinon-chai": "2.6",
"lodash": "^2.4.1"
},

and then deleting node_modules dir and running 'npm install' again makes things work again.

Instead of including your own copy of sinon and chai, can you simply use the ones already installed by the user?

For example, there is already a karma-chai plugin, a karma-sinon plugin which both work well. And neither of them includes their own copy of the respective package.

If this is a plugin which intends to auto load "sinon-chai", then you should just add the entry of snon-chai to the files array and that's it. This also would save you a lot of efforts of keeping track of the dependencies updates.

Thoughts?

Getting Chai is not defined errors

Hello,

After installing and running I get the following error:
image

By the way, using an older version (with older dependencies) of this project works fine.

breaking changes changelog?

Hey,
I really like this module, great work!

When I tried to upgrade to 3.0.0 a few tests broke. I was just wondering if there is a changelog somewhere mentioning the breaking changes?
Why are there breaking changes, is it because Sinon or Chai released new major version? If so, maybe I can find a document describing the breaking changes there?

Cheers.

Version 1.3.1 introducing major dependency upgrade

Hey, not sure if it was intended but 1.3.1 was published to NPM this morning with a major dependency jump from Sinonv1 to Sinonv2. You may want to consider the dropping of Sinon1 as a major release to not break legacy rebuilds.

peerDependencies are locked

peerDependencies should probably be using greater than or equal to. As an example, sinon has a new major version coming out and npm complains since since its not in the same range

Version 1.3.0 was a breaking change

It changed sinon's peerDep to require a major version change. This should have made this a major version update as well instead of a minor

Update version of lolex and/or make it optional?

While I did #56, I noticed that the lolex dependency is still on version 1.6.0 while lolex is now on 2.3.2. Also, looking at the index.js in this package, it looks like it doesn't use lolex so much as provide it. I've personally never needed lolex. Wouldn't it be nice if lolex was an optional dependency? That way, people can bring whatever version of lolex they want. Just a thought.

Let me know if that's something you'd be into supporting. I'd be happy to make a PR.

Support Karma 0.12

I´m running into a problem with Karma 0.12 and its siblings peer dependencies requirements.

No Longer Maintained?

Is this project still being maintained? There are a few critical issues preventing users from using this package successfully, and the PR's seem to be sitting untouched. For the time being, to unblock myself, I have forked this to: https://github.com/davezuko/karma-better-sinon-chai and published it to npm (npm i karma-better-sinon-chai). I will gladly deprecate this package if the issues mentioned below get resolved and published; just wanting to help out!

Fatal Issues

  • lolex is a dependency but is marked as a peerDependency. This means users must install karma-sinon-chai and then, after some debugging, realize that they must install it themselves. Futhermore, peerDependencies are deprecated in npm3. The relevant issue has been untouched since February.
  • sinon@^1.7.2 no longer includes the sinon-timers package, and this is explicitly referenced from karma-sinon-chai here. A PR to fix this has remained unmerged for over a month.

Getting 'Mismatched anonymous define()'

Looks like it's the same issue with #15, which has been closed.

Still having the same issue with v1.1.0

Error message is:
PhantomJS 1.9.8 (Mac OS X 0.0.0) ERROR
Error: Mismatched anonymous define() module: function () {
return sinonChai;
}
http://requirejs.org/docs/errors.html#mismatch
at /Users/wwluo/work/ctp-mobile/node_modules/requirejs/require.js:140

karma config is:
frameworks: ['mocha', 'requirejs', 'sinon-chai']

rolling back to v0.2.0 fixes the issue.

Getting 'Mismatched anonymous define()'

I replaced karma-chai with karma-sinon-chai in my working karma/mocha/chai Grunt configuration, and now I get:

Uncaught Error: Mismatched anonymous define() module: function () {
          return sinonChai;
      }

My Karma configuration has
frameworks: ['mocha', 'requirejs', 'chai-datetime', 'sinon-chai']

This looks similar to an old Chai issue: princed/karma-chai-plugins#3

Can't grep individual tests in when running with mocha

When running with karma and mocha there is an option to execute only specific tests with a grep expression

karma start
karma run -- --grep="manager tests"

but this doesn't work when using the karma-sinon-chai plugin since the command line config is lost in the chai-adapter.js.

Replacing the following line in chai-adapter.js
karma.start();
with
karma.start(karma.config);

makes the mocha adapter pick up the grep argument and only execute the desired tests. Not sure if this is the correct place to fix it, but greping works as expected when the sinon-chai plugin is not included in the karma frameworks config.

Possible breakage due to v1.2.3 running karam#start on karma v0.13.x

I have yet to completely confirm this, I'll work up some tests, but I believe the addition of setting the karma.loaded is causing some strange issues.

In my tests I now have tons of TypeError: Cannot read property 'call' of undefined, as well as half my stubs stopped working. I'll try to pull together some minimal examples to see if it's just the way my tests are written or if this is a breaking change for all of karma v0.13.x.

Karma v0.13.22
Sinon v1.17.4
Chai v3.5.0

Version v1.2.2 of this module works, v1.2.3 works if I comment out the karma.loaded code.

npm peerDependencies warning

npm WARN peerDependencies The peer dependency lolex@^1.4.0 included from karma-sinon-chai will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency sinon-chai@^2.8.0 included from karma-sinon-chai will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.

lodash version?

Hi, sorry if this is a bit OCD but... I'm trying to tidy up my npm dependencies in a project using "npm outdated" and getting the below message; is it possible you could update the lodash version dependency in karma-sinon-chai ? Just thought I'd ask. Thank you, -dB

davids-mbp:dBWeb davidwbarrows$ npm outdated
Package Current Wanted Latest Location
cli-color 0.3.3 0.3.3 1.0.0 cli-color
lodash 2.4.2 2.4.2 3.10.1 lodash
merge-stream 0.1.8 0.1.8 1.0.0 merge-stream
davids-mbp:dBWeb davidwbarrows$ npm update
npm WARN unmet dependency /Users/davidwbarrows/Data/Computing/Angular/dBWeb/node_modules/karma-sinon-chai requires lodash@'^2.4.1' but will load
npm WARN unmet dependency /Users/davidwbarrows/Data/Computing/Angular/dBWeb/node_modules/lodash,
npm WARN unmet dependency which is version 3.10.1
[email protected] node_modules/lodash

Issue with the setting frameworks: ['mocha', 'requirejs', 'sinon-chai'] in karma.conf.js when using karma-sinon-chai with RequireJs

While working on a project that is using RequireJs, I found that to get Karma runner to work with karma-sinon-chai. The setting in karma.conf.js needs to read frameworks: ['mocha', 'requirejs', 'sinon-chai']. It appears to be a problem not being able to set the properties below if 'requirejs' is not set before 'sinon-chai':

  1. window.chai.should()
  2. window.chai.expect
  3. window.chai.expect

Is that the correct setting for using karma-sinon-chai with RequireJs

sinon-chai just bumped to 3.0.0

I don't see why this shouldn't support it out of the box. It should only require a change to the version of the peerDependencies to include the new major version of sinon-chai.

Local bower dependency may not be installed by NPM

I just had trouble installing the latest version of karma-sinon-chai, and it looks like you cannot always rely on bower being present in the local node_modules folder.

My project also has bower as a dependency, and as such the post_install 2dc5275 failed as bower was present at the top level node_modules folder.

See isaacs/npm#1341 for more details of the underlying npm behaviour.

Server start failed on port 9876: Error: Cannot find module 'sinon/package.json'

Hi,

After adding this package to my project karma throws and refuses to start:

ERROR [karma-server]: Server start failed on port 9876: Error: Cannot find module 'sinon/package.json'

Is there any more dep. I need to install along this package or what could be wrong?
Thanks!

I'm using:
"karma": "^4.0.0",
chrome: 71
OSX.

ReferenceError: Can't find variable: chai

What does it mean?

17 07 2015 16:45:31.239:INFO [karma]: Karma v0.13.1 server started at http://localhost:9876/
17 07 2015 16:45:31.249:INFO [launcher]: Starting browser PhantomJS
17 07 2015 16:45:31.481:INFO [PhantomJS 1.9.8 (Linux 0.0.0)]: Connected on socket 3EAMNnOhXQnVs70-AAAA with id 12171161
PhantomJS 1.9.8 (Linux 0.0.0) ERROR
  ReferenceError: Can't find variable: chai
  at /home/kuchumovn/pussy_face/node_modules/karma-sinon-chai/node_modules/sinon-chai/lib/sinon-chai.js:9


[16:45:31] 'test' errored after 14 s
[16:45:31] Error: 1
  at formatError (/usr/local/lib/node_modules/gulp/bin/gulp.js:169:10)
  at Gulp.<anonymous> (/usr/local/lib/node_modules/gulp/bin/gulp.js:195:15)
  at Gulp.EventEmitter.emit (events.js:95:17)
  at Gulp.Orchestrator._emitTaskDone (/home/kuchumovn/pussy_face/node_modules/gulp/node_modules/orchestrator/index.js:264:8)
  at /home/kuchumovn/pussy_face/node_modules/gulp/node_modules/orchestrator/index.js:275:23
  at finish (/home/kuchumovn/pussy_face/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:21:8)
  at cb (/home/kuchumovn/pussy_face/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:29:3)
  at removeAllListeners (/home/kuchumovn/pussy_face/node_modules/karma/lib/server.js:301:7)
  at Server.<anonymous> (/home/kuchumovn/pussy_face/node_modules/karma/lib/server.js:312:9)
  at Server.g (events.js:180:16)
  at Server.EventEmitter.emit (events.js:117:20)
  at net.js:1273:10
  at process._tickCallback (node.js:415:13)

They say:

Your unit test has the line require('../index'), but the problem is that your test is going to run in a browser environment, which does not have a native require function (hence the ReferenceError). If you need to include a separate file you could us the "requirejs" library (which is intended for browsers). Or you could use a <script> tag in your HTML file? Or maybe just a simple Ajax call...

Cannot find module 'lolex'

Hello,

Since I moved my project from 1.1.0 to 1.2.0, I got the following error:

Error: Cannot find module 'lolex'
at Function.Module._resolveFilename (module.js:339:15)
at Function.require.resolve (internal/module.js:23:19)
at framework (/…/node_modules/karma-sinon-chai/index.js:26:40)

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.