mirror of
https://github.com/gchq/CyberChef.git
synced 2025-06-13 17:55:27 -04:00
added tests
This commit is contained in:
parent
98c008a0f1
commit
a2e9bd86d2
3 changed files with 47 additions and 2 deletions
2
package-lock.json
generated
2
package-lock.json
generated
|
@ -102,7 +102,6 @@
|
|||
"vkbeautify": "^0.99.3",
|
||||
"xpath": "0.0.34",
|
||||
"xregexp": "^5.1.1",
|
||||
"yaml": "^2.8.0",
|
||||
"zlibjs": "^0.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
@ -19249,6 +19248,7 @@
|
|||
"version": "2.8.0",
|
||||
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.0.tgz",
|
||||
"integrity": "sha512-4lLa/EcQCB0cJkyts+FpIRx5G/llPxfP6VQU5KByHEhLxY3IJCH0f0Hy1MHI8sClTvsIb8qwRJ6R/ZdlDJ/leQ==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"bin": {
|
||||
"yaml": "bin.mjs"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* @author c.saipraneeth888@gmail.com [c.saipraneeth888@gmail.com]
|
||||
* @author MrMadFox [c.saipraneeth888@gmail.com]
|
||||
* @copyright Crown Copyright 2025
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
|
|
45
tests/operations/tests/YAMLBeautify.mjs
Normal file
45
tests/operations/tests/YAMLBeautify.mjs
Normal file
|
@ -0,0 +1,45 @@
|
|||
/**
|
||||
* YamlBeautifier tests.
|
||||
*
|
||||
* @author MrMadFox [c.saipraneeth888@gmail.com]
|
||||
* @copyright Crown Copyright 2018
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
import TestRegister from "../../lib/TestRegister.mjs";
|
||||
|
||||
TestRegister.addTests(
|
||||
[{
|
||||
name: "YAML Beautify: basic YAML",
|
||||
input: "key1: value1\nkey2: value2",
|
||||
expectedOutput: "key1: value1\nkey2: value2\n",
|
||||
recipeConfig: [{
|
||||
"op": "YAML Beautify",
|
||||
"args": []
|
||||
}]
|
||||
}, {
|
||||
name: "YAML Beautify: nested YAML",
|
||||
input: "key1:\n subkey1: value1\n subkey2: value2\nkey2: value3",
|
||||
expectedOutput: "key1:\n subkey1: value1\n subkey2: value2\nkey2: value3\n",
|
||||
recipeConfig: [{
|
||||
"op": "YAML Beautify",
|
||||
"args": []
|
||||
}]
|
||||
}, {
|
||||
name: "YAML Beautify: empty YAML",
|
||||
input: "",
|
||||
expectedOutput: "",
|
||||
recipeConfig: [{
|
||||
"op": "YAML Beautify",
|
||||
"args": []
|
||||
}]
|
||||
}, {
|
||||
name: "YAML Beautify: malformed YAML",
|
||||
input: "key1: value1\nkey2: value2\nkey3",
|
||||
expectedOutput: "key1: value",
|
||||
recipeConfig: [{
|
||||
"op": "YAML Beautify",
|
||||
"args": []
|
||||
}]
|
||||
}
|
||||
]);
|
Loading…
Add table
Add a link
Reference in a new issue