raduken
raduken

Reputation: 2119

.grunt folder created in the project after run grunt jasmine

I just noticed today, when i run: grunt jasmine

That create a folder .grunt in my main project folder with :grunt-contrib-jasmine , that is normal? i dont't think so.

I am Using Phantomjs for test by terminal

I have already that folder in my node_modules grunt-contrib-jasmine

I am not understand why everytime when i run a test creat that folder, any idea?

package.json

"devDependencies": {
    "grunt": "*",
    "grunt-contrib-concat": "*",
    "grunt-contrib-jade": "*",
    "grunt-contrib-jasmine": "*",
    "grunt-contrib-jshint": "*",
    "grunt-contrib-sass": "*",
    "grunt-contrib-uglify": "*",
    "grunt-contrib-watch": "*"
  },
  "dependencies": {
    "phantomjs": "^1.9.18"
  }

Gruntfile.js

var jasmine;
    config.jasmine = jasmine = {};

    jasmine.test = {
        src:"public/javascripts/test/test.js"
        , options:{
            specs: "spec/test.spec.js"
            , keepRunner: true
            // , host: 'http://localhost/demo-site/'
        }
    };

Upvotes: 0

Views: 133

Answers (1)

matatk
matatk

Reputation: 851

This is normal behaviour. You are right that Jasmine's code is already stored somewhere under node_modules/, but most people set this to be ignored by revision control systems (such as git). Creating a folder outside of node_modules/ means that Jasmine's code can be stored in the repository, and thus hosted on the web, e.g. via GitHub Pages.

This can be really useful for people who are developing JavaScript libraries, as it allows people visiting the hosted site to run the tests directly.

Personally I'd like to be able to change the location of the saved Jasmine code, as I already have a test/ directory, where the SpecRunner is saved. There is a GitHub issue on the .grunt directory.

Upvotes: 2

Related Questions