gruntjs

grunt not running QUnit tests on phantom

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-17 20:22:34
问题 I've got a repository which is integrated with travis. I've got QUnit tests which I'd like to run from grunt/node server side and AMD (requirejs). This is the source of my AMD init.js: (function () { require.config({ baseUrl: "../src" }); require(["../test/suites/basic", '../test/qunit-extend', 'qunit' ], function(BasicTests) { QUnit.config.autoload = false; QUnit.config.autostart = false; BasicTests.run(); QUnit.load(); QUnit.start(); }); }()); When I run those QUnit tests within my browser

grunt not running QUnit tests on phantom

风格不统一 提交于 2019-12-17 20:15:41
问题 I've got a repository which is integrated with travis. I've got QUnit tests which I'd like to run from grunt/node server side and AMD (requirejs). This is the source of my AMD init.js: (function () { require.config({ baseUrl: "../src" }); require(["../test/suites/basic", '../test/qunit-extend', 'qunit' ], function(BasicTests) { QUnit.config.autoload = false; QUnit.config.autostart = false; BasicTests.run(); QUnit.load(); QUnit.start(); }); }()); When I run those QUnit tests within my browser

How to modify grunt watch tasks based on the file changed?

给你一囗甜甜゛ 提交于 2019-12-17 19:07:05
问题 I'm writing a node.js program that will watch a directory filled with a large (300-ish) amount of scss projects. Grunt-watch (run either through the node module or on its own, whatever works) will be configured so that whenever a scss file is changed, it will be compiled with compass, the output file moved to a separate directory, for example: ./1234/style.scss was changed >> grunt-watch runs grunt-compass >> /foo/bar/baz/1234/style.css updated The project directory that the file was in is

Angular “Unknown Provider” error after minification with Grunt Build in Yeoman app

不问归期 提交于 2019-12-17 18:27:48
问题 I'm having problems with grunt build on a Yeoman generated Angular app, using Coffee and Slim, with all libraries up-to-date. (The app was just generated a few days ago with the most recent generator.) grunt build and grunt server both worked fine initially. But after a few days of development using grunt server , I discovered that grunt build had stopped working entirely. There were a few different problems that I fixed. The biggest one was that I had to abandon Slim entirely for my index

Karma: Running a single test file from command line

[亡魂溺海] 提交于 2019-12-17 17:33:54
问题 So, I've been looking all over for this, found "similar" answers here, but not exactly what I want. Right now if I want to test a single file with karma, I need to do fit() , fdescribe() on the file in question... However, what I do want is to be able to just call karma, with the config file, and direct it to a specific file, so I don't need to modify the file at all, ie: karma run --conf karma.conf.js --file /path/to/specific/test_file.js is it possible to do this? Or with any helper? (using

What's the purpose of gruntjs server task?

為{幸葍}努か 提交于 2019-12-17 17:25:38
问题 I'm learning how to propel use gruntjs. I found the server task but I can't get the point. Can i use the server task mapping concatenated/minified files to test my application (uses backbone.js) without moving or placing source files in web server root? Without apache for example. If no, what's the supposed use of server task? 回答1: The server task is used to start a static server with the base path set as the web root. Example: Serve ./web-root as http://localhost:8080/ : grunt.initConfig({

Grunt: Watch multiple files, Compile only Changed

馋奶兔 提交于 2019-12-17 15:42:56
问题 I'm new to Grunt, and so far I'm enjoying it very much. I want Grunt to compile only the changed files when running grunt watch In my Grunfile.coffee I currently have (relevant parts). Note: assets/javascript/app.coffee and assets/javascript/app.js are directories coffee: default: expand: true cwd: "assets/javascript/app.coffee" src: ["*.coffee"] dest: "assets/javascript/app.js" ext: ".js" uglify: dev: options: beautify: true compress: false mangle: false preserveComments: 'all' files: "js

Alternate grunt.js tasks for dev/prod environments

你离开我真会死。 提交于 2019-12-17 15:27:43
问题 I am trying to set up my grunt.js file so it only runs the min task when running on my production server - when running on my local dev server I don't want to min my code with every change as it is unnecessary. Any ideas on how grunt.js can differentiate between dev/prod environments? 回答1: Register a production task: // on the dev server, only concat grunt.registerTask('default', ['concat']); // on production, concat and minify grunt.registerTask('prod', ['concat', 'min']); On your dev server

Alternate grunt.js tasks for dev/prod environments

心已入冬 提交于 2019-12-17 15:26:13
问题 I am trying to set up my grunt.js file so it only runs the min task when running on my production server - when running on my local dev server I don't want to min my code with every change as it is unnecessary. Any ideas on how grunt.js can differentiate between dev/prod environments? 回答1: Register a production task: // on the dev server, only concat grunt.registerTask('default', ['concat']); // on production, concat and minify grunt.registerTask('prod', ['concat', 'min']); On your dev server

How to install grunt and how to build script with it

倾然丶 夕夏残阳落幕 提交于 2019-12-17 14:59:32
问题 Hi I'm trying to install Grunt on Windows 7 64 bit. I have installed Grunt using commands npm install -g grunt npm install -g grunt-cli but now if I try to do grunt init , it is throwing me an error - A valid Gruntfile could not be found. Please see the getting started guide for more information on how to configure grunt: http://gruntjs.com/getting-started Fatal error: Unable to find Gruntfile. But when I look inside the grunt folder on my system the Gruntfile.js is there. can someone please