Swap out mocha/chai for jest

This commit is contained in:
David Edmondson
2021-08-26 16:24:29 -07:00
parent 1a8bcf66cc
commit ab4863e7df
8 changed files with 12400 additions and 2481 deletions

View File

@@ -1,5 +1,10 @@
# Unit Tests
This directory contains unit tests for Bitburner.
Unit tests use Mocha/Chai and are run using mochapack (a mocha-webpack fork).
Run the test command with `npm run test`
Unit tests use jest.
## Running
Run tests with: `npm run test`
To watch for changes: `npm run test:watch`

View File

@@ -1,24 +0,0 @@
<html>
<!-- NOT CURRENTLY USED. Used to run mocha in browser -->
<head>
<meta charset="utf-8">
<title>Mocha Tests</title>
<link href="https://unpkg.com/mocha@6.1.4/mocha.css" rel="stylesheet" />
</head>
<body>
<div id="mocha"></div>
<script defer src="https://unpkg.com/chai/chai.js"></script>
<script defer src="https://unpkg.com/mocha/mocha.js"></script>
<script type="module" class="mocha-init">
mocha.setup('bdd');
mocha.checkLeaks();
</script>
<script type="module" src="test.bundle.js"></script>
<script class="mocha-exec" type="module">
console.log("Running Tests");
mocha.run();
</script>
</body>
</html>

View File

@@ -1,5 +0,0 @@
export * from "./Netscript/DynamicRamCalculationTests";
export * from "./Netscript/StaticRamCalculationTests";
export * from "./StockMarketTests";
export * from "./StringHelperFunctionsTests";
export * from "./Terminal/DirectoryTests";