Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Updated jshint plugin to allow exclusion of jasmine functions
  • Loading branch information
rjwaring committed Jun 17, 2015
commit f0f27fdc253bdea7d4e9e7e6ad32b5c3eb8f0e5f
18 changes: 10 additions & 8 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,13 @@ module.exports = function (grunt) {
browser: true,
globals: {
define: true
}
},
jasmine: true
},
all: [
"Gruntfile",
"togetherjs/*.js"
"togetherjs/*.js",
"togetherjs/tests/jasmine/*.js"
]
},

Expand Down Expand Up @@ -154,7 +156,7 @@ module.exports = function (grunt) {
// forget. Then between git action the build will be over-run,
// but that's harmless.
minimal: {
files: ["togetherjs/**/*.less", "togetherjs/togetherjs.js", "togetherjs/templates-localized.js",
files: ["togetherjs/**/*.less", "togetherjs/togetherjs.js", "togetherjs/templates-localized.js",
"togetherjs/**/*.html", "togetherjs/**/*.js", "!**/*_flymake*", "togetherjs/locales/**/*.json"],
tasks: ["build"]
}
Expand All @@ -181,7 +183,7 @@ module.exports = function (grunt) {

grunt.loadNpmTasks("grunt-contrib-less");
grunt.loadNpmTasks("grunt-contrib-csslint");
grunt.loadNpmTasks("grunt-contrib-jshint");
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks("grunt-contrib-requirejs");
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.loadNpmTasks('grunt-contrib-copy');
Expand Down Expand Up @@ -271,7 +273,7 @@ module.exports = function (grunt) {
var gitCommit = process.env.GIT_COMMIT || "";
var subs = {
__interface_html__: grunt.file.read("togetherjs/interface.html"),
__help_txt__: grunt.file.read("togetherjs/help.txt"),
__help_txt__: grunt.file.read("togetherjs/help.txt"),
__walkthrough_html__: grunt.file.read("togetherjs/walkthrough.html"),
__baseUrl__: baseUrl,
__hubUrl__: hubUrl,
Expand Down Expand Up @@ -324,13 +326,13 @@ module.exports = function (grunt) {
var lang = path.basename(langFilename).replace(/\.json/, "");
var translation = JSON.parse(grunt.file.read(langFilename));
var dest = path.join(grunt.option("dest"), "togetherjs/templates-" + lang + ".js");

var translatedInterface = translateFile("togetherjs/interface.html", translation);
var translatedHelp = translateFile("togetherjs/help.txt", translation);
var translatedWalkthrough = translateFile("togetherjs/walkthrough.html", translation);

var vars = subs;

subs.__interface_html__ = translatedInterface;
subs.__help_txt__ = translatedHelp;
subs.__walkthrough_html__ = translatedWalkthrough;
Expand All @@ -345,7 +347,7 @@ module.exports = function (grunt) {
}
);


function translateFile(source, translation) {
var env = new nunjucks.Environment(new nunjucks.FileSystemLoader("./"));
var tmpl = env.getTemplate(source);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"grunt": "~0.4.1",
"grunt-contrib-copy": "~0.4.1",
"grunt-contrib-csslint": "~0.1.2",
"grunt-contrib-jshint": "~0.4.3",
"grunt-contrib-jshint": "^0.11.2",
"grunt-contrib-less": "~0.5.1",
"grunt-contrib-requirejs": "~0.4.1",
"grunt-contrib-watch": "~0.4.3",
Expand Down
5 changes: 2 additions & 3 deletions togetherjs/tests/jasmine/util.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';

define(['util'], function(util) {
'use strict';
describe('Util', function() {
describe('util.trim', function() {
var testString;
Expand All @@ -26,7 +25,7 @@ define(['util'], function(util) {

expect(util.trim(longTestString)).toEqual(longTestString);
});
})
});
});
});

2 changes: 1 addition & 1 deletion togetherjs/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ define(["jquery", "jqueryPlugins"], function ($) {
};

util.AssertionError = function (message) {
if (! this instanceof util.AssertionError) {
if (! (this instanceof util.AssertionError)) {
return new util.AssertionError(message);
}
this.message = message;
Expand Down