Browse Source

Fixed tests and brought test module naming in line with conventions.

n1474335 8 năm trước cách đây
mục cha
commit
c75ebcf001
4 tập tin đã thay đổi với 6 bổ sung15 xóa
  1. 2 14
      Gruntfile.js
  2. 1 1
      src/core/operations/Code.js
  3. 1 0
      src/node/index.js
  4. 2 0
      test/index.js

+ 2 - 14
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"
-                    }]
                 }
             }
         },

+ 1 - 1
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";
 
 
 /**

+ 1 - 0
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;
 

+ 2 - 0
test/TestRunner.js → 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";