mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-25 17:26:17 -04:00
move node test suite into its own grunt command
This commit is contained in:
parent
f22e9ceec6
commit
9d674ce5a7
9 changed files with 116 additions and 73 deletions
|
@ -0,0 +1,47 @@
|
|||
/* eslint no-console: 0 */
|
||||
|
||||
/**
|
||||
* Node API Test Runner
|
||||
*
|
||||
* @author d98762625 [d98762625@gmail.com]
|
||||
* @author tlwr [toby@toby.codes]
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2018
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
import "babel-polyfill";
|
||||
|
||||
import {
|
||||
setLongTestFailure,
|
||||
logTestReport,
|
||||
} from "../lib/utils";
|
||||
|
||||
// Define global environment functions
|
||||
global.ENVIRONMENT_IS_WORKER = function() {
|
||||
return typeof importScripts === "function";
|
||||
};
|
||||
global.ENVIRONMENT_IS_NODE = function() {
|
||||
return typeof process === "object" && typeof require === "function";
|
||||
};
|
||||
global.ENVIRONMENT_IS_WEB = function() {
|
||||
return typeof window === "object";
|
||||
};
|
||||
|
||||
import TestRegister from "../lib/TestRegister";
|
||||
import "./tests/nodeApi";
|
||||
import "./tests/ops";
|
||||
|
||||
const testStatus = {
|
||||
allTestsPassing: true,
|
||||
counts: {
|
||||
total: 0,
|
||||
}
|
||||
};
|
||||
|
||||
setLongTestFailure();
|
||||
|
||||
const logOpsTestReport = logTestReport.bind(null, testStatus);
|
||||
|
||||
TestRegister.runApiTests()
|
||||
.then(logOpsTestReport);
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue