Socket
Socket
Sign inDemoInstall

grunt-fastly

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-fastly - npm Package Compare versions

Comparing version 0.1.4 to 0.1.5

38

Gruntfile.js

@@ -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();
}
};
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc