Converted all modules from CommonJS to ES6
This commit is contained in:
1 parent
0f2a5014be
commit
131b3a83c1
75 files changed
+395
-282
No files matched your search
@@ -8,7 +8,7 @@
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
var Chef = require("../src/core/Chef.js");
|
||||
import Chef from "../src/core/Chef.js";
|
||||
|
||||
(function() {
|
||||
/**
|
||||
@@ -87,5 +87,7 @@ var Chef = require("../src/core/Chef.js");
|
||||
|
||||
// Singleton TestRegister, keeping things simple and obvious.
|
||||
global.TestRegister = global.TestRegister || new TestRegister();
|
||||
module.exports = global.TestRegister;
|
||||
})();
|
||||
|
||||
export default global.TestRegister;
|
||||
|
||||
+8
-15
@@ -8,25 +8,18 @@
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
var TestRegister = require("./TestRegister.js"),
|
||||
allTestsPassing = true,
|
||||
import TestRegister from "./TestRegister.js";
|
||||
import "./tests/operations/Base58.js";
|
||||
import "./tests/operations/Compress.js";
|
||||
import "./tests/operations/FlowControl.js";
|
||||
import "./tests/operations/MorseCode.js";
|
||||
import "./tests/operations/StrUtils.js";
|
||||
|
||||
var allTestsPassing = true,
|
||||
testStatusCounts = {
|
||||
total: 0,
|
||||
};
|
||||
|
||||
/**
|
||||
* Requires and returns all modules that match.
|
||||
*
|
||||
* @param {Object} requireContext
|
||||
* @returns {Object[]}
|
||||
*/
|
||||
function requireAll(requireContext) {
|
||||
return requireContext.keys().map(requireContext);
|
||||
}
|
||||
|
||||
// Import all tests
|
||||
requireAll(require.context("./tests", true, /.+\.js$/));
|
||||
|
||||
|
||||
/**
|
||||
* Helper function to convert a status to an icon.
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
var TestRegister = require("../../TestRegister.js");
|
||||
import TestRegister from "../../TestRegister.js";
|
||||
|
||||
TestRegister.addTests([
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
var TestRegister = require("../../TestRegister.js");
|
||||
import TestRegister from "../../TestRegister.js";
|
||||
|
||||
TestRegister.addTests([
|
||||
{
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
var TestRegister = require("../../TestRegister.js");
|
||||
import TestRegister from "../../TestRegister.js";
|
||||
|
||||
TestRegister.addTests([
|
||||
{
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
var TestRegister = require("../../TestRegister.js");
|
||||
import TestRegister from "../../TestRegister.js";
|
||||
|
||||
TestRegister.addTests([
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
var TestRegister = require("../../TestRegister.js");
|
||||
import TestRegister from "../../TestRegister.js";
|
||||
|
||||
TestRegister.addTests([
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user