grunt-contrib-templify
Advanced tools
Comparing version 0.0.4 to 0.1.0
@@ -61,42 +61,5 @@ | ||
unit: { | ||
specs: "./spec/**", | ||
specs: ["./specs/**"], | ||
helpers: [] | ||
} | ||
}, | ||
karma: { | ||
options: { | ||
reporters: ["spec", "junit"], | ||
frameworks: ["jasmine"], | ||
singleRun: true, | ||
browsers: ["PhantomJS"], | ||
junitReporter: { | ||
outputDir: "./reports/jasmine", // results will be saved as $outputDir/$browserName.xml | ||
outputFile: undefined, // if included, results will be saved as $outputDir/$browserName/$outputFile | ||
suite: "", // suite will become the package name attribute in xml testsuite element | ||
useBrowserName: true, // add browser name to report and classes names | ||
nameFormatter: undefined, // function (browser, result) to customize the name attribute in xml testcase element | ||
classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element | ||
properties: {} // key value pair of properties to add to the <properties> section of the report | ||
}, | ||
specReporter: { | ||
maxLogLines: 1, // limit number of lines logged per test | ||
suppressErrorSummary: true, // do not print error summary | ||
suppressFailed: false, // do not print information about failed tests | ||
suppressPassed: false, // do not print information about passed tests | ||
suppressSkipped: true, // do not print information about skipped tests | ||
showSpecTiming: false // print the time elapsed for each spec | ||
}, | ||
files: [ | ||
"node_modules/angular/angular.js", | ||
"node_modules/angular-mocks/angular-mocks.js", | ||
"specs/templates.js", | ||
"specs/scenerios.js" | ||
] | ||
}, | ||
unit: { | ||
singleRun: true, | ||
}, | ||
continuous: { | ||
singleRun: false | ||
} | ||
} | ||
@@ -127,3 +90,3 @@ }; | ||
/* Set tasks */ | ||
grunt.registerTask("default", ["eslint:files"]); | ||
grunt.registerTask("default", ["eslint:contrib"]); | ||
grunt.registerTask("test", ["eslint:contrib", "jasmine_nodejs"]); | ||
@@ -130,0 +93,0 @@ // grunt.registerTask("karma", ["eslint:contrib", "karma:continuous"]); |
{ | ||
"name": "grunt-contrib-templify", | ||
"version": "0.0.4", | ||
"version": "0.1.0", | ||
"description": "A simple project for quick and dirty conversion of HTML files to javascript for various cases, particularly unit testing.", | ||
@@ -21,4 +21,4 @@ "main": "index.js", | ||
"author": { | ||
"name": "Alexander Anderson", | ||
"email": "aetherwalker@refugesystems.net" | ||
"name": "Alexander Anderson", | ||
"email": "aetherwalker@refugesystems.net" | ||
}, | ||
@@ -49,3 +49,6 @@ "license": "MIT", | ||
"load-grunt-tasks": "^3.5.2" | ||
}, | ||
"dependencies": { | ||
"glob": "^7.1.2" | ||
} | ||
} |
@@ -59,2 +59,30 @@ # grunt-contrib-templify | ||
* vue | ||
The task creates a Vue Plugin to provide the HTML files as templates: | ||
```javascript | ||
var Templify = {}; | ||
Templify.install = function(Vue, options) { | ||
Vue.templified = function(name) { | ||
switch(name) { | ||
case "[Filename]": return [Template]; | ||
//... | ||
default: return undefined; | ||
} | ||
}; | ||
}; | ||
``` | ||
To use the Plugin, your code will have to call | ||
```javascript | ||
Vue.use(Templify); | ||
``` | ||
And then your components should be able to access their templates: | ||
```javascript | ||
Vue.component("example", { | ||
// ... | ||
"template": Vue.templified("[Filename]") | ||
}); | ||
``` | ||
* jasmine-angular (Also karma-angular) | ||
@@ -61,0 +89,0 @@ |
@@ -7,16 +7,16 @@ | ||
beforeEach(function() { | ||
templifier = require("./tasks/templifier.js"); | ||
templifier = require("../../tasks/templifier.js"); | ||
}); | ||
it("Creates the specified output file when fully specified", function() { | ||
xit("Creates the specified output file when fully specified", function() { | ||
}); | ||
it("Throws an appropriate error when a key configuration is missing", function() { | ||
xit("Throws an appropriate error when a key configuration is missing", function() { | ||
}); | ||
it("responds to path rewrite functions correctly", function() { | ||
xit("responds to path rewrite functions correctly", function() { | ||
}); | ||
}); |
@@ -10,5 +10,5 @@ | ||
it("Creates the specified output file", function() { | ||
xit("Creates the specified output file", function() { | ||
}); | ||
}); |
@@ -10,5 +10,5 @@ | ||
it("Creates the specified output file", function() { | ||
xit("Creates the specified output file", function() { | ||
}); | ||
}); |
@@ -10,5 +10,5 @@ | ||
it("Creates the specified output file", function() { | ||
xit("Creates the specified output file", function() { | ||
}); | ||
}); |
@@ -15,2 +15,4 @@ /* | ||
var glob = require("glob"); | ||
/* Track the current working directory */ | ||
@@ -68,4 +70,7 @@ var currentDir = __dirname.replace(/\\/g, "/") + "/../"; | ||
} | ||
/* Deprecated flat directory search | ||
dir.files = fs.readdirSync(dir.path); | ||
*/ | ||
dir.files = glob.sync(dir.path); | ||
dir.files.forEach(function(file) { | ||
@@ -72,0 +77,0 @@ path = dir.path + file; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21924
24
228
1
317
+ Addedglob@^7.1.2
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addedfs.realpath@1.0.0(transitive)
+ Addedglob@7.2.3(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedminimatch@3.1.2(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedpath-is-absolute@1.0.1(transitive)
+ Addedwrappy@1.0.2(transitive)