import assert from "assert";
import tf, {
  findTestFiles,
  component,
  loadTests,
  runTests,
  printResultsToConsole,
  writeResultsToFile,
  writeResultsToJunitFile,
  failureExitCode
} from "./index";

const run = tf(
  component("assert", assert),
  findTestFiles("./tests/*.test.js"),
  loadTests,
  runTests,
  printResultsToConsole,
  writeResultsToJunitFile("results.xml"),
  writeResultsToFile("results.json"),
  failureExitCode()
);

run();

import assert from "assert";
import tf, {
  findTestFiles,
  component,
  loadTests,
  runTests,
  printResultsToConsole,
  writeResultsToFile,
  writeResultsToJunitFile,
  failureExitCode
} from "./index";

const run = tf(
  component("assert", assert),
  findTestFiles("./tests/*.test.js"),
  loadTests,
  runTests,
  printResultsToConsole,
  failureExitCode(),
  writeResultsToJunitFile("results.xml"),
  writeResultsToFile("results.json")
);

run();

--- 
+++ 
@@ -16,9 +16,9 @@
   loadTests,
   runTests,
   printResultsToConsole,
-  failureExitCode(),
   writeResultsToJunitFile("results.xml"),
-  writeResultsToFile("results.json")
+  writeResultsToFile("results.json"),
+  failureExitCode()
 );
 
 run();
Move exit code to end
