Code Monkey home page Code Monkey logo

Comments (4)

jsoverson avatar jsoverson commented on August 27, 2024

The repo itself is a self-running example of grunt-contrib-jasmine and this template.

To aid in troubleshooting you can build the specrunner and open it in a browser, eg if your task is named "jasmineTest", run grunt jasmine:jasmineTest:build and a _SpecRunner.html file will be generated in your project's root.

It may be worthwhile to fork this repo and configure a template that suits your setup better. Requirejs configurations vary drastically from project to project and the more configuration you have the more custom your setup will need to be.

from grunt-template-jasmine-requirejs.

netpoetica avatar netpoetica commented on August 27, 2024

Okay, giving this a shot. It would definitely be helpful to see what order this lib is loading my scripts in and if it is finding them. I'm not sure where your "jasmineTest" is coming from though. I added a task called jasmineTest and linked it to ['jasmine'], but grunt doesn't like it:

  grunt-contrib-jasmine-example git:(master)  grunt jasmine:jasmineTest:build
Running "jasmine:jasmineTest:build" (jasmine) task
Verifying property jasmine.jasmineTest exists in config...ERROR
>> Unable to process task.
Warning: Required config property "jasmine.jasmineTest" missing. Use --force to continue.

Aborted due to warnings.

So instead I removed the task and tried:

grunt jasmine:build

but no _SpecRunner.html was generated. Here is my Gruntfile.js if there's anything maybe you could flag as me being a durp:

module.exports = function(grunt) {
  'use strict';

  // Project configuration.
  grunt.initConfig({
    meta : {
      src   : 'public/**/*.js',
      specs : 'spec/**/*.js'
    },
    watch: {
      test : {
        files: ['<%= meta.src %>','<%= meta.specs %>'],
        tasks: 'test'
      }
    },
    jasmine : {
      src : '<%= meta.src %>',
      options : {
        template: require('grunt-template-jasmine-requirejs'),
        specs : '<%= meta.specs %>',
        templateOptions: {
            requireConfig: {
                paths: {
                    Backbone: '/js/libs/backbone',
                    jQuery: '/js/libs/jquery',
                    Underscore: '/js/libs/underscore'
                },
                shim: {
                    'Backbone': ['Underscore', 'jQuery']
                }
            }
        }
      }
    },
    jshint: {
      all: [
        'Gruntfile.js',
        '<%= meta.src %>',
        '<%= meta.specs %>'
      ],
      options: {
        jshintrc: '.jshintrc'
      }
    }
  });

  grunt.loadNpmTasks('grunt-contrib-jasmine');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-watch');

  grunt.registerTask('jasmineTest', ['jasmine']);

  grunt.registerTask('test', ['jshint', 'jasmine']);

  // Default task.
  grunt.registerTask('default', ['test']);

};

from grunt-template-jasmine-requirejs.

jsoverson avatar jsoverson commented on August 27, 2024

I see you've opened and closed other repos related to grunt and the grunt 0.4.0 changes. Let me know if you still have issues configuring jasmine with the template.

from grunt-template-jasmine-requirejs.

jsoverson avatar jsoverson commented on August 27, 2024

Closing, let me know if there are further problems.

from grunt-template-jasmine-requirejs.

Related Issues (20)

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.