grunt-fastly
Advanced tools
Comparing version 0.1.4 to 0.1.5
@@ -71,23 +71,23 @@ /* | ||
// grunt.registerTask('mock-fastly', function () { | ||
// var mocker = function (fnName) { | ||
// return function () { | ||
// if (typeof this.calls === 'undefined') { | ||
// this.calls = []; | ||
// } | ||
grunt.registerTask('mock-fastly', function () { | ||
var mocker = function (fnName) { | ||
return function () { | ||
if (typeof this.calls === 'undefined') { | ||
this.calls = []; | ||
} | ||
// this.calls.push({ | ||
// method: fnName, | ||
// arguments: arguments | ||
// }); | ||
this.calls.push({ | ||
method: fnName, | ||
arguments: arguments | ||
}); | ||
// // Call the call back | ||
// _.last(arguments)(); | ||
// }; | ||
// }; | ||
// Call the call back | ||
_.last(arguments)(); | ||
}; | ||
}; | ||
// fastly.purgeAll = mocker('purgeAll'); | ||
// fastly.purgeKey = mocker('purgeKey'); | ||
// fastly.purge = mocker('purge'); | ||
// }); | ||
fastly.purgeAll = mocker('purgeAll'); | ||
fastly.purgeKey = mocker('purgeKey'); | ||
fastly.purge = mocker('purge'); | ||
}); | ||
@@ -97,3 +97,3 @@ // Whenever the "test" task is run, first clean the "tmp" dir, then run this | ||
grunt.registerTask('test', [ | ||
// 'mock-fastly', | ||
'mock-fastly', | ||
'fastly', | ||
@@ -100,0 +100,0 @@ 'nodeunit' |
{ | ||
"name": "grunt-fastly", | ||
"description": "A Grunt plugin to purge cache from Fastly", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"homepage": "https://github.com/coen-hyde/grunt-fastly", | ||
"authors": [ | ||
"Coen Hyde <coen.hyde@gmail.com>", | ||
"Luke Bussey <luke.bussey@gmail.com>" | ||
], | ||
"author": { | ||
"name": "Coen Hyde", | ||
"email": "coen.hyde@gmail.com" | ||
}, | ||
"repository": { | ||
@@ -17,3 +17,8 @@ "type": "git", | ||
}, | ||
"license": "MIT", | ||
"licenses": [ | ||
{ | ||
"type": "MIT", | ||
"url": "https://github.com/coen-hyde/grunt-fastly/blob/master/LICENSE-MIT" | ||
} | ||
], | ||
"main": "Gruntfile.js", | ||
@@ -27,14 +32,12 @@ "engines": { | ||
"devDependencies": { | ||
"grunt-contrib-jshint": "~0.6.0", | ||
"grunt-contrib-nodeunit": "~0.2.0", | ||
"grunt-contrib-jshint": "~0.11.3", | ||
"grunt-contrib-nodeunit": "~0.4.1", | ||
"grunt": "~0.4.1" | ||
}, | ||
"peerDependencies": { | ||
"grunt": "~0.4.1" | ||
"grunt": ">=0.4.0" | ||
}, | ||
"keywords": [ | ||
"gruntplugin", | ||
"fastly", | ||
"purge", | ||
"cdn" | ||
"gruntplugin" | ||
], | ||
@@ -41,0 +44,0 @@ "dependencies": { |
@@ -8,31 +8,26 @@ 'use strict'; | ||
exports.fastly = { | ||
foo: function (test) { | ||
test.expect(1); | ||
test.ok(true, "this assertion should pass"); | ||
test.done(); | ||
} | ||
// purgeAll: function(test) { | ||
// test.expect(2); | ||
purgeAll: function(test) { | ||
test.expect(2); | ||
// var calls = _.filter(fastly.calls, function (call) { | ||
// return (call['method'] === 'purgeAll'); | ||
// }); | ||
var calls = _.filter(fastly.calls, function (call) { | ||
return (call['method'] === 'purgeAll'); | ||
}); | ||
// test.equal(calls.length, 1, 'Number of calls to purgeAll'); | ||
// test.equal(calls[0].arguments['0'], 'service id', 'The service id to purge'); | ||
// test.done(); | ||
// }, | ||
test.equal(calls.length, 1, 'Number of calls to purgeAll'); | ||
test.equal(calls[0].arguments['0'], 'service id', 'The service id to purge'); | ||
test.done(); | ||
}, | ||
// purgeUrls: function(test) { | ||
// test.expect(3); | ||
purgeUrls: function(test) { | ||
test.expect(3); | ||
// var calls = _.filter(fastly.calls, function (call) { | ||
// return (call['method'] === 'purge'); | ||
// }); | ||
var calls = _.filter(fastly.calls, function (call) { | ||
return (call['method'] === 'purge'); | ||
}); | ||
// test.equal(calls.length, 3, 'Number of calls to purgeAll'); | ||
// test.equal(calls[0].arguments['0'], 'example.com', 'The host purge'); | ||
// test.equal(calls[0].arguments['1'], 'folder/picture1.jpg', 'The url purge'); | ||
// test.done(); | ||
// } | ||
test.equal(calls.length, 3, 'Number of calls to purgeAll'); | ||
test.equal(calls[0].arguments['0'], 'example.com', 'The host purge'); | ||
test.equal(calls[0].arguments['1'], 'folder/picture1.jpg', 'The url purge'); | ||
test.done(); | ||
} | ||
}; |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
1
0
11226
197