bessdsv / karma-jasmine-jquery Goto Github PK
View Code? Open in Web Editor NEWJasmine-jquery plugin for Jasmine in Karma
License: Other
Jasmine-jquery plugin for Jasmine in Karma
License: Other
ie8
does not support [email protected]
, so the plugin fails even if I manually specify another the version of jQuery
in my Karma configuration.
jasmine-jquery is outdated.
hi Guys,
I'm trying to install this package via npm but have no luck. it always say can't connect to github. I have my git config global set to use https instead of git protocol and in fact npm install other packages works only this package. Am I missing something? or is there any workaround on this aside from direct cloning?
Thanks
When we install this dependecie there is an critical security issue with shell-quote on the reference version 1.4.3 that is very old
+-- [email protected]
| -- [email protected] (git://github.com/bessdsv/bower-installer.git#7f9cece1e6fada50f44dc0851e1d85815cd1b4a7) |
-- [email protected]
| `-- [email protected]
Hi!
I work behind a firewall, and while packages from npm get through, your dependency on a fork on GitHub does not. Would it be possible to either get you fork's changes merged into the main project or publish your fork on the npm-repo?
The standard BSD licenses are usually the 2-clause, 3-clause or 4-clause licenses. The license file for this library appears to only include the non-liability clause so the type of BSD license is ambiguous.
Could you please update the license file to conform to one of those standards, or at least leave a comment here indicating which license was intended? This helps with legal things when we're choosing to use your library where I work. πThanks!
During karma start I got.
Uncaught ReferenceError: jQuery is not defined
at /var/www/pullr/node_modules/karma-jasmine-jquery/lib/setJqueryForJasminJqueryPlugin.js:1
So seems that is not enough for karma.conf.js
`frameworks: ['jasmine','jasmine-jquery'],`
I've just noticed that in my project (which uses karma-jasmine-jquery
) I get warning during npm install
. This warning is about bower-installer
not installed globally. And it comes as dependency of karma-jasmine-jquery
.
Dev dependencies like bower
shoudln't go into dependencies
section of package.json
to not pollute other projects which are using karma-jasmine-jquery
. They should go into devDependencies
section.
If you want to change the fixturesPath (default spec/javascripts/fixtures
) like described in the documentation, you will not have any success with using:
jasmine.getFixtures().fixturesPath = 'my/new/path';
like described there. The reason is that you will need to add the files inside this path in the "files" object like:
files: [
{
pattern: 'my/new/path/*.html',
included: false,
served: true
}
]
of karma.conf.js
.
This will avoid 404 requests to these files.
Because this information is not an ingredient of jasmine-jquery it should be documented inside this repository.
I have an issue with the Jquery plugins I am loading through requireJS, being attached to $j rather than what is used by the code I am testing (which all use 'jQuery' to refer to jQuery instance)
So, to be clear, in my RequireJS config I have:
shim: {
'vendor/jquery': {
'exports': 'jQuery'
},
'vendor/jquery-ui': [ 'vendor/jquery' ]
And the code I am testing is setup this way:
define([
'vendor/jquery',
'vendor/jquery-ui'
], function (jQuery) {
So I have confirmed that $j shows the jquery-ui as being defined (widget and ui properties are defined for example), but neither $ or jQuery have have any ui definitions registered into it therefore my code although it finds jQuery reference, it fails because it does not find jquery-ui component specific calls.
I am not able to change the way the code is tested as it is part of a large team project. I am hoping to somehow route the jQuery instance or plugins properly so that they are found by my code. Is there any way to set this up?
Thanks in advance!
Danny
As this topic describes
http://stackoverflow.com/questions/25847986/no-provider-for-jasmine-jquery
it is not possible to use karma-jasmine-jquery without adding it into the "plugins" array. This is not described in the documentation.
Hi,
I'm trying to get karma-jasmine-jquery working on a new project and I'm having some trouble - I'm not sure where the issue is. I am using karma-jasmine version 0.3.5, jasmine-core 2.2.0, and karma-jasmine-jquery 0.1.1. When I try to run this test:
describe("experimentation", function() {
var elem;
beforeEach(function() {
elem = $('<div id="container"><p>Hello World</p></div>');
});
it("allows us to serach with Css selectors", function() {
expect(elem).toBe('#container');
expect(elem).toContainElement('p');
expect(elem).toEqual('#container');
expect(elem).toEqual('p')
});
});
and I get the following errors:
experimentation
β allows us to serach with Css selectors
Expected ({ 0: HTMLNode, length: 1 }) to be '#container'.
at /var/folders/zg/yn1mt9m55w385c2k_jkyd9_5xztm6l/T/dda6e3ae7d9f204ac6ce90332d2945ef.browserify:4211
Expected ({ 0: HTMLNode, length: 1 }) to equal '#container'.
at /var/folders/zg/yn1mt9m55w385c2k_jkyd9_5xztm6l/T/dda6e3ae7d9f204ac6ce90332d2945ef.browserify:4213
Expected ({ 0: HTMLNode, length: 1 }) to equal 'p'.
at /var/folders/zg/yn1mt9m55w385c2k_jkyd9_5xztm6l/T/dda6e3ae7d9f204ac6ce90332d2945ef.browserify:4214
Is there a version conflict that I'm not seeing? I know that jasmine-jquery is loaded because I can load fixtures without any issues and the method toContainElement
works fine. It seems that only the jQuery selectors are affected.
Not sure if the issue lies with this library, one of the jasmine libraries, or (most likely) something I'm doing wrong. Any help you could provide would be much appreciated. Thanks!
Trying to load some fixtures to test some DOM functionality. They're not loading:
before(() => {
jasmine.getFixtures().fixturesPath = 'base/src/__tests__/fixtures';
loadFixtures('index.html');
})
Hi,
I'm not very aware of the internals of jquery events, but it seems there's a problem with spyOnEvent.
I'm using a version of jQuery in my tested code loaded via karma.set, in the "files" list. I'm using Browserify too, but jquery is used via the global $ var in my modules.
I can't manage to get spyOnEvent working... Even a simple test like this is failling:
setFixtures(sandbox().html('<a id="clickme">Click Me</a>'));
var $element = $('#clickme');
var spy = spyOnEvent($element, 'click');
$element.click();
expect(spy).toHaveBeenTriggered();
After digging a bit, I've found that I'm using a different version of jquery (more recent) and spyOnEvent is using it's own version (as specified here https://github.com/bessdsv/karma-jasmine-jquery#information) so everything looks "normal"
The fact is, if I switch from $('#clickme')
to $j('#clickme')
, to use the "internal" karma-jasmine-jquery jquery, the test pass just fine. Of course, my code can't use that version.
To be clear, it's not specifically the jquery version causing that problem; I tried to use the same exact version (2.1.1) in my own code, and it's not working. Seems that some internal data are specific to each jquery loaded or something like that.
Did some else have this problem ?
Hello,
I originally posted this bug report on the jasmine-jquery github ( velesin/jasmine-jquery#251 ), but it appears that the issue is Karma related. The bug is as follows:
The "toHandle" function:
var testSubject = $( '#test-subject' );
testSubject.on( 'click', function () {
// my callback
} );
expect( testSubject ).toHandle( 'click' );
Returns (failed test):
Expected ({
0: HTMLNode,
length: 1,
context: HTMLNode,
selector: '#test-subject'
}) to handle 'click'. at Object.<anonymous> (/home/marcbraulio/Projects/test/test/hello-world.js:27:31)
The "toHandleWith" Function:
var testSubject = $( '#test-subject' );
var callback = function () {
// my callback
}
testSubject.on( 'click', callback );
expect( testSubject ).toHandleWith( 'click', callback );
Returns (error):
TypeError: Cannot read property 'click' of undefined at compare (/home/marcbraulio/Projects/test/node_modules/karma-jasmine-jquery/lib/jasmine-jquery.js:596:60) at Object.<anonymous> (/home/marcbraulio/Projects/test/test/hello-world.js:41:31)
This is happening in an isolated installation of the following packages (running on Ubuntu 15.04):
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
I narrowed it down to Karma because with an isolated installation using just jasmine with jasmine-jquery, both of those tests pass. This can be seen here: http://jsfiddle.net/marcbraulio/nqh7djsa/2/
Thank you for your time.
"bower-installer": "git+https://github.com/bessdsv/bower-installer.git#temp"
https://github.blog/2021-09-01-improving-git-protocol-security-github/
Hi,
I am using karma to test my js files which also using jquery. I downloaded all of the karma, karma-jasmine, jasmine-core, karma-coverage and also karma-jasmine-jquery. However, when I tried to add jquery-1.3.2, as the README file directions, into the frameworks array, the mvn package shows the error: Error: No provider for "framework:jquery-1"! (Resolving: framework:jquery-1). I also did not find any jquery resources under the node_modules files. I am stuck with this problem. Does anyone have any idea? any advice will be appreciated. OS: windows 10, all of the plugins are installed by npm install. all of these dependencies are all included in package.json file.
Thank you. :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.