From c75ebcf001cf42a60bf9549524d9125e14edb38a Mon Sep 17 00:00:00 2001 From: n1474335 Date: Sat, 25 Mar 2017 13:32:35 +0000 Subject: [PATCH] Fixed tests and brought test module naming in line with conventions. --- Gruntfile.js | 16 ++-------------- src/core/operations/Code.js | 2 +- src/node/index.js | 1 + test/{TestRunner.js => index.js} | 2 ++ 4 files changed, 6 insertions(+), 15 deletions(-) rename test/{TestRunner.js => index.js} (98%) diff --git a/Gruntfile.js b/Gruntfile.js index 3719969f..5394b966 100755 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -210,32 +210,20 @@ module.exports = function (grunt) { }, tests: { target: "node", - entry: ["babel-polyfill", "./test/TestRunner.js"], + entry: "./test/index.js", output: { filename: "index.js", path: "build/test" - }, - module: { - loaders: [{ - test: /prettify\.min\.js$/, - use: "imports-loader?window=>global" - }] } }, node: { target: "node", - entry: ["babel-polyfill", "./src/node/index.js"], + entry: "./src/node/index.js", output: { filename: "CyberChef.js", path: "build/node", library: "CyberChef", libraryTarget: "commonjs2" - }, - module: { - loaders: [{ - test: /prettify\.min\.js$/, - use: "imports-loader?window=>global" - }] } } }, diff --git a/src/core/operations/Code.js b/src/core/operations/Code.js index 91d2bf0b..32c147ef 100755 --- a/src/core/operations/Code.js +++ b/src/core/operations/Code.js @@ -2,7 +2,7 @@ import Utils from "../Utils.js"; import vkbeautify from "vkbeautify"; import {DOMParser as dom} from "xmldom"; import xpath from "xpath"; -import prettyPrintOne from "exports-loader?prettyPrintOne!google-code-prettify/bin/prettify.min.js"; +import prettyPrintOne from "imports-loader?window=>global!exports-loader?prettyPrintOne!google-code-prettify/bin/prettify.min.js"; /** diff --git a/src/node/index.js b/src/node/index.js index 61b2f549..c65e83de 100644 --- a/src/node/index.js +++ b/src/node/index.js @@ -5,6 +5,7 @@ * @copyright Crown Copyright 2017 * @license Apache-2.0 */ +import "babel-polyfill"; var Chef = require("../core/Chef.js").default; diff --git a/test/TestRunner.js b/test/index.js similarity index 98% rename from test/TestRunner.js rename to test/index.js index e0d735fb..09eeee8e 100644 --- a/test/TestRunner.js +++ b/test/index.js @@ -8,6 +8,8 @@ * @copyright Crown Copyright 2017 * @license Apache-2.0 */ +import "babel-polyfill"; + import TestRegister from "./TestRegister.js"; import "./tests/operations/Base58.js"; import "./tests/operations/Compress.js";