index.mjs 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. /* eslint no-console: 0 */
  2. /**
  3. * Test Runner
  4. *
  5. * For running the tests in the test register.
  6. *
  7. * @author tlwr [toby@toby.codes]
  8. * @author n1474335 [n1474335@gmail.com]
  9. * @copyright Crown Copyright 2017
  10. * @license Apache-2.0
  11. */
  12. import {
  13. setLongTestFailure,
  14. logTestReport,
  15. } from "../lib/utils.mjs";
  16. import TestRegister from "../lib/TestRegister.mjs";
  17. import "./tests/BCD.mjs";
  18. import "./tests/BSON.mjs";
  19. import "./tests/BaconCipher.mjs";
  20. import "./tests/Base58.mjs";
  21. import "./tests/Base64.mjs";
  22. import "./tests/Base62.mjs";
  23. import "./tests/BitwiseOp.mjs";
  24. import "./tests/ByteRepr.mjs";
  25. import "./tests/CartesianProduct.mjs";
  26. import "./tests/CharEnc.mjs";
  27. import "./tests/ChangeIPFormat.mjs";
  28. import "./tests/Charts.mjs";
  29. import "./tests/Checksum.mjs";
  30. import "./tests/Ciphers.mjs";
  31. import "./tests/Code.mjs";
  32. import "./tests/Comment.mjs";
  33. import "./tests/Compress.mjs";
  34. import "./tests/ConditionalJump.mjs";
  35. import "./tests/Crypt.mjs";
  36. import "./tests/CSV.mjs";
  37. import "./tests/DateTime.mjs";
  38. import "./tests/ExtractEmailAddresses.mjs";
  39. import "./tests/Fork.mjs";
  40. import "./tests/FromDecimal.mjs";
  41. import "./tests/Hash.mjs";
  42. import "./tests/HaversineDistance.mjs";
  43. import "./tests/Hexdump.mjs";
  44. import "./tests/Image.mjs";
  45. import "./tests/IndexOfCoincidence.mjs";
  46. import "./tests/Jump.mjs";
  47. import "./tests/JSONBeautify.mjs";
  48. import "./tests/JSONMinify.mjs";
  49. import "./tests/JSONtoCSV.mjs";
  50. import "./tests/JWTDecode.mjs";
  51. import "./tests/JWTSign.mjs";
  52. import "./tests/JWTVerify.mjs";
  53. import "./tests/MS.mjs";
  54. import "./tests/Magic.mjs";
  55. import "./tests/MorseCode.mjs";
  56. import "./tests/NetBIOS.mjs";
  57. import "./tests/OTP.mjs";
  58. import "./tests/PGP.mjs";
  59. import "./tests/PHP.mjs";
  60. import "./tests/ParseIPRange.mjs";
  61. import "./tests/ParseQRCode.mjs";
  62. import "./tests/PowerSet.mjs";
  63. import "./tests/Regex.mjs";
  64. import "./tests/Register.mjs";
  65. import "./tests/RemoveDiacritics.mjs";
  66. import "./tests/Rotate.mjs";
  67. import "./tests/SeqUtils.mjs";
  68. import "./tests/SetDifference.mjs";
  69. import "./tests/SetIntersection.mjs";
  70. import "./tests/SetUnion.mjs";
  71. import "./tests/StrUtils.mjs";
  72. import "./tests/SymmetricDifference.mjs";
  73. import "./tests/TextEncodingBruteForce.mjs";
  74. import "./tests/TranslateDateTimeFormat.mjs";
  75. import "./tests/Magic.mjs";
  76. import "./tests/ParseTLV.mjs";
  77. import "./tests/Media.mjs";
  78. import "./tests/ToFromInsensitiveRegex.mjs";
  79. import "./tests/YARA.mjs";
  80. import "./tests/ConvertCoordinateFormat.mjs";
  81. import "./tests/Enigma.mjs";
  82. import "./tests/Bombe.mjs";
  83. import "./tests/MultipleBombe.mjs";
  84. import "./tests/Typex.mjs";
  85. import "./tests/BLAKE2b.mjs";
  86. import "./tests/BLAKE2s.mjs";
  87. import "./tests/Protobuf.mjs";
  88. import "./tests/ParseSSHHostKey.mjs";
  89. import "./tests/DefangIP.mjs";
  90. import "./tests/ParseUDP.mjs";
  91. import "./tests/AvroToJSON";
  92. // Cannot test operations that use the File type yet
  93. // import "./tests/SplitColourChannels.mjs";
  94. const testStatus = {
  95. allTestsPassing: true,
  96. counts: {
  97. total: 0,
  98. }
  99. };
  100. setLongTestFailure();
  101. const logOpsTestReport = logTestReport.bind(null, testStatus);
  102. TestRegister.runTests()
  103. .then(logOpsTestReport);