karma-jasmine-jquery icon indicating copy to clipboard operation
karma-jasmine-jquery copied to clipboard

Remove GitHub dependency

Open SimenB opened this issue 10 years ago • 18 comments

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?

SimenB avatar Feb 28 '15 12:02 SimenB

What do you mean? In npm-repo is a last version of GitHub Sources. Can you show me a differences?

bessdsv avatar Mar 02 '15 10:03 bessdsv

The main difference for us would be that this would be usable for us at all. We are not able to clone from github, but we can pull down from NPM.

For others, it would be that they can lock the version, and not get whatever is at the tip of your fork. Shrinkwrap will make the build reproducible

SimenB avatar Mar 02 '15 10:03 SimenB

Thank you for your good work!. Using the default version of jQuery work great. I am trying to use a different version jquery. My karma.config.js has the following sections: ... frameworks: ['jquery-1.5.2', 'jasmine-jquery', 'jasmine' ], plugins: [ 'karma-chrome-launcher', 'karma-html2js-preprocessor', 'karma-jasmine-jquery', 'karma-jasmine',
], ... I have all modules installed globally : npm install -g karma karma-cli karma-chrome-launcher karma-firefox-launcher karma-html2js-preprocessor karma-environments karma-chrome-launcher karma-firefox-launcher bower jasmine-jquery karma-jasmine karma-jasmine-jquery

If I run karma without 'jquery-1.5.2' in the framework array all is fine. When I add 'jquery-1.5.2', I go the following error message:

karma karma.conf.js DEBUG [plugin]: Loading plugin karma-chrome-launcher. DEBUG [plugin]: Loading plugin karma-html2js-preprocessor. DEBUG [plugin]: Loading plugin karma-jasmine-jquery. DEBUG [plugin]: Loading plugin karma-jasmine.

/home/twhite/.nvm/v0.10.36/lib/node_modules/karma/node_modules/di/lib/injector.js:9 throw error('No provider for "' + name + '"!'); ^ Error: No provider for "framework:jquery-1"! (Resolving: framework:jquery-1) at error (/home/twhite/.nvm/v0.10.36/lib/node_modules/karma/node_modules/di/lib/injector.js:22:68) at Object.parent.get (/home/twhite/.nvm/v0.10.36/lib/node_modules/karma/node_modules/di/lib/injector.js:9:13) at get (/home/twhite/.nvm/v0.10.36/lib/node_modules/karma/node_modules/di/lib/injector.js:54:19) at get (/home/twhite/.nvm/v0.10.36/lib/node_modules/karma/node_modules/di/lib/injector.js:28:19) at /home/twhite/.nvm/v0.10.36/lib/node_modules/karma/lib/server.js:31:14 at Array.forEach (native)

Any ideas?

thomaswhite avatar Mar 03 '15 11:03 thomaswhite

Sorry for the noise - I figured it out - karma-jquery do not include this version.

thomaswhite avatar Mar 03 '15 12:03 thomaswhite

SimenB, Sorry, I'm not so long ago been programming on node and githab. can you write in more detail what should i do in code? Or make pool request with the desired changes?

bessdsv avatar Mar 03 '15 18:03 bessdsv

@bessdsv Sorry about the slow response

In your dependencies, you reference your own fork of a project. https://github.com/bessdsv/karma-jasmine-jquery/blob/master/package.json#L32

What I'd like to happen is that you either make a PR back upstream to github.com/blittle/bower-installer, or publish your fork as a separate npm-module, to avoid having a git-dependency.

Make sense?

SimenB avatar Mar 29 '15 17:03 SimenB

@SimenB I did PR for a long time, but for some reason the maintainer does not merge. Create new module in the NPM is not desirable, and probably not correct. Perhaps I will be able to rewrite the project after upgrading to a new version of Bower-installer next month.

bessdsv avatar Mar 30 '15 07:03 bessdsv

Did you have any luck resolving this? It appears the bower.json file in the karma-jasmine-jquery package has bower-install as a dependency, but it doesn't allow for downloading this dependency using the https url, only the git protocol. As I am on a corporate network, I can't install this package. If I try git clone https://github.com/bessdsv/bower-installer.git it clones fine. However it appears that when npm tries to install karma-jasmine-jquery, it uses https, but when it gets to the bower-install dependency it only uses git - which fails.

farnsy avatar Aug 17 '15 01:08 farnsy

Nope, but we've upgraded to Jasmine@2, so we can use the jasmine-jquery npm-package directly, no need for this package. (just put the path to node_modules at the top of files, or use AMD/CJS/ES6-imports)

SimenB avatar Aug 17 '15 05:08 SimenB

Thanks for the tips here - added it as a reference in files, and all works great.

farnsy avatar Aug 17 '15 23:08 farnsy

@SimenB I'm having the same issue behind a firewall. Tried using jasmine-jquery straight up, but am getting an error during karma start. No provider for framework:jasmine-jquery. Did you or anyone else run into this?

rsquared86 avatar Nov 11 '15 18:11 rsquared86

What does your config look like?

SimenB avatar Nov 11 '15 19:11 SimenB

module.exports = function(config) { config.set({

// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '../../..',

// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['jasmine-jquery', 'jasmine'],

// list of files / patterns to load in the browser
files: [
    'node_modules/jasmine-jquery/lib/jasmine-jquery.js',

    // core libraries
    'src/main/webapp/app/assets/libs/jquery.min.js',
    'src/main/webapp/app/assets/libs/angular.min.js',
    'src/main/webapp/app/assets/libs/angular-cookies.min.js',
    'src/main/webapp/app/assets/libs/angular-resource.min.js',
    'src/main/webapp/app/assets/libs/angular-touch.min.js',
    //'src/main/webapp/app/assets/libs/angular-route.min.js',
    'src/main/webapp/app/assets/libs/angular-ui-router.js',
    'src/main/webapp/app/assets/libs/bootstrap.min.js',
    'src/main/webapp/app/assets/libs/owl.carousel.min.js',
    'src/main/webapp/app/assets/libs/ui-bootstrap-tpls.min.js',

    // testing libraries
    'node_modules/angular-mocks/angular-mocks.js',

    // app scripts
    'src/main/webapp/app/*.js',
    'src/main/webapp/app/*.module.js',
    'src/main/webapp/app/*.filters.js',
    'src/main/webapp/app/*.routes.js',
    'src/main/webapp/app/core/*.module.js',
    'src/main/webapp/app/core/*.js',
    'src/main/webapp/app/services/*.module.js', 
    'src/main/webapp/app/services/*.js',
    'src/main/webapp/app/widgets/*.module.js',
    'src/main/webapp/app/widgets/*.js',
    'src/main/webapp/app/widgets/**/*.js',      
    'src/main/webapp/app/home/*.module.js',
    'src/main/webapp/app/home/*.js',
    'src/main/webapp/app/listing/*.module.js',
    'src/main/webapp/app/listing/*.js',
    'src/main/webapp/app/detail/*.module.js',
    'src/main/webapp/app/detail/*.js',

    // templates
    'src/main/webapp/app/widgets/**/*.html',


    // testing scripts
    'src/test/js/**/*.js',
    'src/test/js/*.js',

    //mock data
    //'src/test/mock/*.json'
    // fixtures
    {pattern: 'src/test/mock/*.json', watched: true, served: true, included: false}
],

// list of files to exclude
exclude: [
],

// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
    'src/main/webapp/app/**/*.js' : ['coverage'],
    'src/main/webapp/app/widgets/**/*.html': ['ng-html2js']
    //'src/test/mock/*.json': ['ng-html2js']
},

ngHtml2JsPreprocessor: {

    // strip this from the file path
    stripPrefix: 'src/main/webapp',

    moduleName: 'templates'
},

// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress', 'coverage'],

// web server port
port: 9876,

// enable / disable colors in the output (reporters and logs)
colors: true,

// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,

// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,

// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['Chrome', 'PhantomJS'],

// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false

}) }

rsquared86 avatar Nov 11 '15 19:11 rsquared86

If you use jasmine-jquery directly, you don't put it into frameworks, just add it to files

SimenB avatar Nov 11 '15 20:11 SimenB

Thats what it was. Thank you!

rsquared86 avatar Nov 11 '15 20:11 rsquared86

:+1:

SimenB avatar Nov 11 '15 20:11 SimenB

I have the same problem and I don't understand why this is (10 months later) still an issue.

julkue avatar Dec 11 '15 12:12 julkue

@bessdsv Can you replace protocol of bower-installer git dependency in your package.json?

"bower-installer": "git://github.com/bessdsv/bower-installer.git#temp"

to

"bower-installer": "https://github.com/bessdsv/bower-installer.git#temp"

https://github.com/bessdsv/karma-jasmine-jquery/blob/master/package.json

boxersb avatar Feb 19 '16 09:02 boxersb