5 changed files with 134 additions and 7 deletions
Split View
Diff Options
-
63lib/pins.js
-
28lib/storage/file.js
-
42scripts/compare-pin-methods.js
-
2scripts/evict-inactive.js
-
6www/auth/main.js
@ -0,0 +1,42 @@ |
|||
/* jshint esversion: 6, node: true */ |
|||
const nThen = require("nthen"); |
|||
const Pins = require("../lib/pins"); |
|||
const Assert = require("assert"); |
|||
|
|||
const config = require("../lib/load-config"); |
|||
|
|||
var compare = function () { |
|||
console.log(config); |
|||
var conf = { |
|||
pinPath: config.pinPath, |
|||
}; |
|||
|
|||
var list, load; |
|||
|
|||
nThen(function (w) { |
|||
Pins.list(w(function (err, p) { |
|||
if (err) { throw err; } |
|||
list = p; |
|||
console.log(p); |
|||
console.log(list); |
|||
console.log(); |
|||
}), conf); |
|||
}).nThen(function (w) { |
|||
Pins.load(w(function (err, p) { |
|||
if (err) { throw err; } |
|||
load = p; |
|||
console.log(load); |
|||
console.log(); |
|||
}), conf); |
|||
}).nThen(function () { |
|||
console.log({ |
|||
listLength: Object.keys(list).length, |
|||
loadLength: Object.keys(load).length, |
|||
}); |
|||
|
|||
Assert.deepEqual(list, load); |
|||
console.log("methods are equivalent"); |
|||
}); |
|||
}; |
|||
|
|||
compare(); |
|||
Write
Preview
Loading…
Cancel
Save