【问题标题】:.grunt folder created in the project after run grunt jasmine运行 grunt jasmine 后在项目中创建的 .grunt 文件夹
【发布时间】:2015-08-19 11:12:32
【问题描述】:

我今天刚注意到,当我跑步时: grunt jasmine

使用 :grunt-contrib-jasmine 在我的主项目文件夹中创建一个文件夹 .grunt ,这正常吗?我不这么认为。

我正在使用 Phantomjs 进行终端测试

我的 node_modules 中已经有那个文件夹 咕噜-贡献-茉莉花

我不明白为什么每次运行测试时都会创建该文件夹,知道吗?

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/'
        }
    };

【问题讨论】:

    标签: gruntjs jasmine phantomjs grunt-contrib-jasmine


    【解决方案1】:

    这是正常行为。没错,Jasmine 的代码已经存储在 node_modules/ 下的某个地方,但大多数人将其设置为被修订控制系统(例如 git)忽略。在node_modules/ 之外创建一个文件夹意味着 Jasmine 的代码可以存储在存储库中,从而托管在网络上,例如通过GitHub Pages

    这对于开发 JavaScript 库的人来说非常有用,因为它允许访问托管站点的人直接运行测试。

    我个人希望能够更改保存的 Jasmine 代码的位置,因为我已经有一个 test/ 目录,其中保存了 SpecRunner。有一个GitHub issue on the .grunt directory

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-05-30
      • 1970-01-01
      • 2023-03-27
      • 2015-07-19
      • 2014-09-02
      • 1970-01-01
      相关资源
      最近更新 更多