Embedding dependencies (e.g. jQuery) in the library when Grunt starts

I am creating a Javascript library using Yeoman, and would like to load some dependency scripts when starting Grunt. For example, I want to use jQuery code in my tests, however, when I do this, now the test suite tells me that $ is not defined .

I have included jQuery in the devDependencies package. How do I proceed?

Thank!

+3
source share
1 answer

If you want to use jQuery in your test (I think you use karma), you must include jquery in your k file aram.conf.js. For instance:

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


    // list of files / patterns to load in the browser
    files: [
      'app/bower_components/jquery/jquery.js',
      .....
    ],
....
+1
source

All Articles