|
@@ -11,7 +11,7 @@ module.exports = function(grunt) {
|
|
|
|
|
|
grunt.registerTask("test",
|
|
grunt.registerTask("test",
|
|
"A task which runs all the tests in test/tests.",
|
|
"A task which runs all the tests in test/tests.",
|
|
- ["clean:test", "concat:jsTest", "copy:htmlTest", "chmod:build", "exec:tests"]);
|
|
|
|
|
|
+ ["clean:test", "concat:jsTest", "copy:htmlTest", "chmod:build", "execute:test"]);
|
|
|
|
|
|
grunt.registerTask("prod",
|
|
grunt.registerTask("prod",
|
|
"Creates a production-ready build. Use the --msg flag to add a compile message.",
|
|
"Creates a production-ready build. Use the --msg flag to add a compile message.",
|
|
@@ -35,6 +35,7 @@ module.exports = function(grunt) {
|
|
["eslint", "exec:stats", "exec:displayStats"]);
|
|
["eslint", "exec:stats", "exec:displayStats"]);
|
|
|
|
|
|
grunt.registerTask("doc", "docs");
|
|
grunt.registerTask("doc", "docs");
|
|
|
|
+ grunt.registerTask("tests", "test");
|
|
grunt.registerTask("lint", "eslint");
|
|
grunt.registerTask("lint", "eslint");
|
|
|
|
|
|
|
|
|
|
@@ -50,6 +51,7 @@ module.exports = function(grunt) {
|
|
grunt.loadNpmTasks("grunt-inline-alt");
|
|
grunt.loadNpmTasks("grunt-inline-alt");
|
|
grunt.loadNpmTasks("grunt-chmod");
|
|
grunt.loadNpmTasks("grunt-chmod");
|
|
grunt.loadNpmTasks("grunt-exec");
|
|
grunt.loadNpmTasks("grunt-exec");
|
|
|
|
+ grunt.loadNpmTasks("grunt-execute");
|
|
grunt.loadNpmTasks("grunt-contrib-watch");
|
|
grunt.loadNpmTasks("grunt-contrib-watch");
|
|
|
|
|
|
|
|
|
|
@@ -161,22 +163,16 @@ module.exports = function(grunt) {
|
|
|
|
|
|
];
|
|
];
|
|
|
|
|
|
- var jsAppFiles = [].concat(
|
|
|
|
- jsIncludes,
|
|
|
|
- [
|
|
|
|
- // Start the main app!
|
|
|
|
- "src/js/views/html/main.js",
|
|
|
|
- ]
|
|
|
|
- );
|
|
|
|
-
|
|
|
|
- var jsTestFiles = [].concat(
|
|
|
|
- jsIncludes,
|
|
|
|
- [
|
|
|
|
- "test/TestRegister.js",
|
|
|
|
- "test/tests/**/*.js",
|
|
|
|
- "test/TestRunner.js",
|
|
|
|
- ]
|
|
|
|
- );
|
|
|
|
|
|
+ var jsAppFiles = jsIncludes.concat([
|
|
|
|
+ // Start the main app!
|
|
|
|
+ "src/js/views/html/main.js",
|
|
|
|
+ ]);
|
|
|
|
+
|
|
|
|
+ var jsTestFiles = jsIncludes.concat([
|
|
|
|
+ "test/TestRegister.js",
|
|
|
|
+ "test/tests/**/*.js",
|
|
|
|
+ "test/TestRunner.js",
|
|
|
|
+ ]);
|
|
|
|
|
|
var banner = '/**\n\
|
|
var banner = '/**\n\
|
|
* CyberChef - The Cyber Swiss Army Knife\n\
|
|
* CyberChef - The Cyber Swiss Army Knife\n\
|
|
@@ -218,11 +214,7 @@ module.exports = function(grunt) {
|
|
config: ["src/js/config/**/*.js"],
|
|
config: ["src/js/config/**/*.js"],
|
|
views: ["src/js/views/**/*.js"],
|
|
views: ["src/js/views/**/*.js"],
|
|
operations: ["src/js/operations/**/*.js"],
|
|
operations: ["src/js/operations/**/*.js"],
|
|
- tests: [
|
|
|
|
- "test/**/*.js",
|
|
|
|
- "!test/PhantomRunner.js",
|
|
|
|
- "!test/NodeRunner.js",
|
|
|
|
- ],
|
|
|
|
|
|
+ tests: ["test/**/*.js"],
|
|
},
|
|
},
|
|
jsdoc: {
|
|
jsdoc: {
|
|
options: {
|
|
options: {
|
|
@@ -241,8 +233,8 @@ module.exports = function(grunt) {
|
|
},
|
|
},
|
|
clean: {
|
|
clean: {
|
|
dev: ["build/dev/*"],
|
|
dev: ["build/dev/*"],
|
|
- test: ["build/test/*"],
|
|
|
|
prod: ["build/prod/*"],
|
|
prod: ["build/prod/*"],
|
|
|
|
+ test: ["build/test/*"],
|
|
docs: ["docs/*", "!docs/*.conf.json", "!docs/*.ico"],
|
|
docs: ["docs/*", "!docs/*.conf.json", "!docs/*.ico"],
|
|
},
|
|
},
|
|
concat: {
|
|
concat: {
|
|
@@ -291,12 +283,7 @@ module.exports = function(grunt) {
|
|
dest: "build/dev/index.html"
|
|
dest: "build/dev/index.html"
|
|
},
|
|
},
|
|
htmlTest: {
|
|
htmlTest: {
|
|
- options: {
|
|
|
|
- process: function(content, srcpath) {
|
|
|
|
- return grunt.template.process(content, templateOptions);
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- src: "src/html/test.html",
|
|
|
|
|
|
+ src: "test/test.html",
|
|
dest: "build/test/index.html"
|
|
dest: "build/test/index.html"
|
|
},
|
|
},
|
|
htmlProd: {
|
|
htmlProd: {
|
|
@@ -451,9 +438,6 @@ module.exports = function(grunt) {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
exec: {
|
|
exec: {
|
|
- tests: {
|
|
|
|
- command: "node test/NodeRunner.js",
|
|
|
|
- },
|
|
|
|
repoSize: {
|
|
repoSize: {
|
|
command: [
|
|
command: [
|
|
"git ls-files | wc -l | xargs printf '\n%b\ttracked files\n'",
|
|
"git ls-files | wc -l | xargs printf '\n%b\ttracked files\n'",
|
|
@@ -506,6 +490,9 @@ module.exports = function(grunt) {
|
|
].join(";")
|
|
].join(";")
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ execute: {
|
|
|
|
+ test: "test/NodeRunner.js"
|
|
|
|
+ },
|
|
watch: {
|
|
watch: {
|
|
css: {
|
|
css: {
|
|
files: "src/css/**/*.css",
|
|
files: "src/css/**/*.css",
|