Finished first run through of tests
This commit is contained in:
parent
8675d1a666
commit
a6c0db47ab
@ -19,9 +19,6 @@ export default [
|
|||||||
"Unzip",
|
"Unzip",
|
||||||
"Zip",
|
"Zip",
|
||||||
|
|
||||||
// Also uses files
|
|
||||||
"DetectFileType",
|
|
||||||
"ExtractEXIF",
|
|
||||||
|
|
||||||
// Relies on state of recipe.
|
// Relies on state of recipe.
|
||||||
// "Magic",
|
// "Magic",
|
||||||
|
@ -57,6 +57,7 @@ import {
|
|||||||
DecodeText as core_DecodeText,
|
DecodeText as core_DecodeText,
|
||||||
DeriveEVPKey as core_DeriveEVPKey,
|
DeriveEVPKey as core_DeriveEVPKey,
|
||||||
DerivePBKDF2Key as core_DerivePBKDF2Key,
|
DerivePBKDF2Key as core_DerivePBKDF2Key,
|
||||||
|
DetectFileType as core_DetectFileType,
|
||||||
Diff as core_Diff,
|
Diff as core_Diff,
|
||||||
DisassembleX86 as core_DisassembleX86,
|
DisassembleX86 as core_DisassembleX86,
|
||||||
Divide as core_Divide,
|
Divide as core_Divide,
|
||||||
@ -69,6 +70,7 @@ import {
|
|||||||
ExpandAlphabetRange as core_ExpandAlphabetRange,
|
ExpandAlphabetRange as core_ExpandAlphabetRange,
|
||||||
ExtractDates as core_ExtractDates,
|
ExtractDates as core_ExtractDates,
|
||||||
ExtractDomains as core_ExtractDomains,
|
ExtractDomains as core_ExtractDomains,
|
||||||
|
ExtractEXIF as core_ExtractEXIF,
|
||||||
ExtractEmailAddresses as core_ExtractEmailAddresses,
|
ExtractEmailAddresses as core_ExtractEmailAddresses,
|
||||||
ExtractFilePaths as core_ExtractFilePaths,
|
ExtractFilePaths as core_ExtractFilePaths,
|
||||||
ExtractIPAddresses as core_ExtractIPAddresses,
|
ExtractIPAddresses as core_ExtractIPAddresses,
|
||||||
@ -316,6 +318,7 @@ function generateChef() {
|
|||||||
"decodeText": wrap(core_DecodeText),
|
"decodeText": wrap(core_DecodeText),
|
||||||
"deriveEVPKey": wrap(core_DeriveEVPKey),
|
"deriveEVPKey": wrap(core_DeriveEVPKey),
|
||||||
"derivePBKDF2Key": wrap(core_DerivePBKDF2Key),
|
"derivePBKDF2Key": wrap(core_DerivePBKDF2Key),
|
||||||
|
"detectFileType": wrap(core_DetectFileType),
|
||||||
"diff": wrap(core_Diff),
|
"diff": wrap(core_Diff),
|
||||||
"disassembleX86": wrap(core_DisassembleX86),
|
"disassembleX86": wrap(core_DisassembleX86),
|
||||||
"divide": wrap(core_Divide),
|
"divide": wrap(core_Divide),
|
||||||
@ -328,6 +331,7 @@ function generateChef() {
|
|||||||
"expandAlphabetRange": wrap(core_ExpandAlphabetRange),
|
"expandAlphabetRange": wrap(core_ExpandAlphabetRange),
|
||||||
"extractDates": wrap(core_ExtractDates),
|
"extractDates": wrap(core_ExtractDates),
|
||||||
"extractDomains": wrap(core_ExtractDomains),
|
"extractDomains": wrap(core_ExtractDomains),
|
||||||
|
"extractEXIF": wrap(core_ExtractEXIF),
|
||||||
"extractEmailAddresses": wrap(core_ExtractEmailAddresses),
|
"extractEmailAddresses": wrap(core_ExtractEmailAddresses),
|
||||||
"extractFilePaths": wrap(core_ExtractFilePaths),
|
"extractFilePaths": wrap(core_ExtractFilePaths),
|
||||||
"extractIPAddresses": wrap(core_ExtractIPAddresses),
|
"extractIPAddresses": wrap(core_ExtractIPAddresses),
|
||||||
@ -559,6 +563,7 @@ const decodeNetBIOSName = chef.decodeNetBIOSName;
|
|||||||
const decodeText = chef.decodeText;
|
const decodeText = chef.decodeText;
|
||||||
const deriveEVPKey = chef.deriveEVPKey;
|
const deriveEVPKey = chef.deriveEVPKey;
|
||||||
const derivePBKDF2Key = chef.derivePBKDF2Key;
|
const derivePBKDF2Key = chef.derivePBKDF2Key;
|
||||||
|
const detectFileType = chef.detectFileType;
|
||||||
const diff = chef.diff;
|
const diff = chef.diff;
|
||||||
const disassembleX86 = chef.disassembleX86;
|
const disassembleX86 = chef.disassembleX86;
|
||||||
const divide = chef.divide;
|
const divide = chef.divide;
|
||||||
@ -571,6 +576,7 @@ const escapeUnicodeCharacters = chef.escapeUnicodeCharacters;
|
|||||||
const expandAlphabetRange = chef.expandAlphabetRange;
|
const expandAlphabetRange = chef.expandAlphabetRange;
|
||||||
const extractDates = chef.extractDates;
|
const extractDates = chef.extractDates;
|
||||||
const extractDomains = chef.extractDomains;
|
const extractDomains = chef.extractDomains;
|
||||||
|
const extractEXIF = chef.extractEXIF;
|
||||||
const extractEmailAddresses = chef.extractEmailAddresses;
|
const extractEmailAddresses = chef.extractEmailAddresses;
|
||||||
const extractFilePaths = chef.extractFilePaths;
|
const extractFilePaths = chef.extractFilePaths;
|
||||||
const extractIPAddresses = chef.extractIPAddresses;
|
const extractIPAddresses = chef.extractIPAddresses;
|
||||||
@ -800,6 +806,7 @@ const operations = [
|
|||||||
decodeText,
|
decodeText,
|
||||||
deriveEVPKey,
|
deriveEVPKey,
|
||||||
derivePBKDF2Key,
|
derivePBKDF2Key,
|
||||||
|
detectFileType,
|
||||||
diff,
|
diff,
|
||||||
disassembleX86,
|
disassembleX86,
|
||||||
divide,
|
divide,
|
||||||
@ -812,6 +819,7 @@ const operations = [
|
|||||||
expandAlphabetRange,
|
expandAlphabetRange,
|
||||||
extractDates,
|
extractDates,
|
||||||
extractDomains,
|
extractDomains,
|
||||||
|
extractEXIF,
|
||||||
extractEmailAddresses,
|
extractEmailAddresses,
|
||||||
extractFilePaths,
|
extractFilePaths,
|
||||||
extractIPAddresses,
|
extractIPAddresses,
|
||||||
@ -1044,6 +1052,7 @@ export {
|
|||||||
decodeText,
|
decodeText,
|
||||||
deriveEVPKey,
|
deriveEVPKey,
|
||||||
derivePBKDF2Key,
|
derivePBKDF2Key,
|
||||||
|
detectFileType,
|
||||||
diff,
|
diff,
|
||||||
disassembleX86,
|
disassembleX86,
|
||||||
divide,
|
divide,
|
||||||
@ -1056,6 +1065,7 @@ export {
|
|||||||
expandAlphabetRange,
|
expandAlphabetRange,
|
||||||
extractDates,
|
extractDates,
|
||||||
extractDomains,
|
extractDomains,
|
||||||
|
extractEXIF,
|
||||||
extractEmailAddresses,
|
extractEmailAddresses,
|
||||||
extractFilePaths,
|
extractFilePaths,
|
||||||
extractIPAddresses,
|
extractIPAddresses,
|
||||||
|
@ -938,6 +938,13 @@ smothering ampersand abreast
|
|||||||
assert.strictEqual(chef.toCamelCase("Quickest Wheel").toString(), "quickestWheel");
|
assert.strictEqual(chef.toCamelCase("Quickest Wheel").toString(), "quickestWheel");
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
it("toHex: accepts args", () => {
|
||||||
|
const result = toHex("some input", {
|
||||||
|
delimiter: "Colon",
|
||||||
|
});
|
||||||
|
assert.strictEqual(result.toString(), "73:6f:6d:65:20:69:6e:70:75:74");
|
||||||
|
}),
|
||||||
|
|
||||||
it("To Kebab case", () => {
|
it("To Kebab case", () => {
|
||||||
assert.strictEqual(chef.toKebabCase("Elfin Gold").toString(), "elfin-gold");
|
assert.strictEqual(chef.toKebabCase("Elfin Gold").toString(), "elfin-gold");
|
||||||
}),
|
}),
|
||||||
@ -978,11 +985,36 @@ smothering ampersand abreast
|
|||||||
</contact-info>`);
|
</contact-info>`);
|
||||||
}),
|
}),
|
||||||
|
|
||||||
it("toHex: accepts args", () => {
|
it("XPath expression", () => {
|
||||||
const result = toHex("some input", {
|
assert.strictEqual(
|
||||||
delimiter: "Colon",
|
chef.XPathExpression("<contact-info><company>abc</company></contact-info>", {xPath: "contact-info/company"}).toString(),
|
||||||
});
|
"<company>abc</company>");
|
||||||
assert.strictEqual(result.toString(), "73:6f:6d:65:20:69:6e:70:75:74");
|
}),
|
||||||
|
|
||||||
|
it("Zlib deflate / inflate", () => {
|
||||||
|
assert.strictEqual(chef.zlibInflate(chef.zlibDeflate("cut homer wile rooky grits dizen")).toString(), "cut homer wile rooky grits dizen");
|
||||||
|
}),
|
||||||
|
|
||||||
|
|
||||||
|
it("Detect file type", () => {
|
||||||
|
assert.strictEqual(
|
||||||
|
chef.detectFileType(fs.readFileSync("test/tests/nodeApi/sampleData/pic.jpg")).toString(),
|
||||||
|
`File extension: jpg
|
||||||
|
MIME type: image/jpeg`);
|
||||||
|
}),
|
||||||
|
|
||||||
|
it("extract EXIF", () => {
|
||||||
|
assert.strictEqual(
|
||||||
|
chef.extractEXIF(fs.readFileSync("test/tests/nodeApi/sampleData/pic.jpg")).toString(),
|
||||||
|
`Found 7 tags.
|
||||||
|
|
||||||
|
Orientation: 1
|
||||||
|
XResolution: 72
|
||||||
|
YResolution: 72
|
||||||
|
ResolutionUnit: 2
|
||||||
|
ColorSpace: 1
|
||||||
|
ExifImageWidth: 57
|
||||||
|
ExifImageHeight: 57`);
|
||||||
}),
|
}),
|
||||||
|
|
||||||
]);
|
]);
|
||||||
|
Loading…
Reference in New Issue
Block a user