mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-17 14:59:16 +02:00
Converted mocha unit tests to run using mocha-webpack (mochapack) package
This commit is contained in:
11
test/Netscript/DynamicRamCalculationTests.js
Normal file
11
test/Netscript/DynamicRamCalculationTests.js
Normal file
@@ -0,0 +1,11 @@
|
||||
// TODO Importing NetscriptFunctions breaks the mochapack build
|
||||
// import { NetscriptFunctions } from "../../src/NetscriptFunctions";
|
||||
import { expect } from "chai";
|
||||
|
||||
console.log("Beginning Netscript Dynamic RAM Calculation/Generation Tests");
|
||||
|
||||
describe("Netscript Static RAM Calculation/Generation Tests", function() {
|
||||
it("should run", function() {
|
||||
expect(1).to.equal(1);
|
||||
});
|
||||
});
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
# Unit Tests
|
||||
This directory contains unit tests for Bitburner.
|
||||
|
||||
Unit tests use Mocha/Chai and are run through the browser. The Mocha/Chai
|
||||
packages are sourced directly in HTML.
|
||||
Unit tests use Mocha/Chai and are run using mochapack (mocha-webpack fork).
|
||||
Run the test command with `npm run test`
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { CONSTANTS } from "../src/Constants";
|
||||
import { Order } from "../src/StockMarket/Order";
|
||||
//import { processOrders } from "../src/StockMarket/OrderProcessing";
|
||||
// import { processOrders } from "../src/StockMarket/OrderProcessing";
|
||||
import { Stock } from "../src/StockMarket/Stock";
|
||||
/*
|
||||
import {
|
||||
deleteStockMarket,
|
||||
initStockMarket,
|
||||
@@ -11,7 +10,6 @@ import {
|
||||
StockMarket,
|
||||
SymbolToStockMap,
|
||||
} from "../src/StockMarket/StockMarket";
|
||||
*/
|
||||
import {
|
||||
calculateIncreasingPriceMovement,
|
||||
calculateDecreasingPriceMovement,
|
||||
@@ -24,8 +22,9 @@ import {
|
||||
import { OrderTypes } from "../src/StockMarket/data/OrderTypes"
|
||||
import { PositionTypes } from "../src/StockMarket/data/PositionTypes";
|
||||
|
||||
const assert = chai.assert;
|
||||
const expect = chai.expect;
|
||||
//const assert = chai.assert;
|
||||
//const expect = chai.expect;
|
||||
import { expect } from "chai";
|
||||
|
||||
console.log("Beginning Stock Market Tests");
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<html>
|
||||
<!-- From https://medium.com/dailyjs/running-mocha-tests-as-native-es6-modules-in-a-browser-882373f2ecb0 -->
|
||||
<!-- NOT CURRENTLY USED. Used to run mocha in browser -->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Mocha Tests</title>
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
// export * from "./Netscript/DynamicRamCalculationTests";
|
||||
export * from "./Netscript/StaticRamCalculationTests";
|
||||
export * from "./StockMarketTests";
|
||||
|
||||
2035
test/tests.bundle.js
2035
test/tests.bundle.js
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
4889
test/tests.css
4889
test/tests.css
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user