Add ObjectId timestamp parser operation

This commit is contained in:
Dominic Fitch-Jones 2020-03-21 17:42:17 -04:00
parent 26b19350f2
commit 9f4ef9cdad
No known key found for this signature in database
GPG key ID: 4195836A7638B91D
4 changed files with 74 additions and 2 deletions

View file

@ -100,6 +100,7 @@ import "./tests/Lorenz.mjs";
import "./tests/LuhnChecksum.mjs";
import "./tests/CipherSaber2.mjs";
import "./tests/Colossus.mjs";
import "./tests/ParseObjectIdTimestamp.mjs";
// Cannot test operations that use the File type yet
@ -120,4 +121,3 @@ const logOpsTestReport = logTestReport.bind(null, testStatus);
const results = await TestRegister.runTests();
logOpsTestReport(results);
})();

View file

@ -0,0 +1,24 @@
/**
* Parse ObjectId timestamp tests
*
* @author dmfj [dominic@dmfj.io]
*
* @copyright Crown Copyright 2018
* @license Apache-2.0
*/
import TestRegister from "../../lib/TestRegister.mjs";
TestRegister.addTests([
{
name: "Parse ISO timestamp from ObjectId",
input: "000000000000000000000000",
expectedOutput: "1970-01-01T00:00:00.000Z",
recipeConfig: [
{
op: "Parse ObjectId timestamp",
args: [],
}
],
}
]);