spreadsheet
typeScript/javascript spreadsheet parser, with formulas.
git clone https://git.vogt.world/spreadsheet.git
Log | Files | README.md
← Commit log
commit
message
Adding 'clean' to npm scripts, moving tests around, ensuring all tests get run.
author
Ben Vogt <[email protected]>
date
2017-04-29 23:24:21
stats
11 file(s) changed, 35 insertions(+), 25 deletions(-)
files
package.json
tests.sh
tests/DateFormulasTest.ts
tests/Formulas/DateFormulasTest.ts
tests/DateFormulasTestTimeOverride.ts
tests/Formulas/DateFormulasTestTimeOverride.ts
tests/EngineeringTest.ts
tests/Formulas/EngineeringTest.ts
tests/FinancialTest.ts
tests/Formulas/FinancialTest.ts
tests/HelperTest.ts
tests/Formulas/HelperTest.ts
tests/LogicalTest.ts
tests/Formulas/LogicalTest.ts
tests/MathTest.ts
tests/Formulas/MathTest.ts
tests/StatisticalTest.ts
tests/Formulas/StatisticalTest.ts
tests/TextTest.ts
tests/Formulas/TextTest.ts
  1diff --git a/package.json b/package.json
  2index 2e1e34c..0d8f309 100644
  3--- a/package.json
  4+++ b/package.json
  5@@ -3,6 +3,7 @@
  6   "version": "1.0.0",
  7   "description": "TypeScript implementation of a spreadsheet.",
  8   "scripts": {
  9+    "clean": "rm -rf output/* && rm -rf test_output/*",
 10     "build": "tsc && cp lib/parser.js output/",
 11     "test": "./tests.sh"
 12   },
 13diff --git a/tests.sh b/tests.sh
 14index f08b91d..54aeca8 100755
 15--- a/tests.sh
 16+++ b/tests.sh
 17@@ -2,12 +2,13 @@
 18 
 19 echo "$(date) Compiling Tests"
 20 tsc --outDir test_output tests/*.ts
 21+tsc --outDir test_output tests/*/*.ts
 22 cp lib/parser.js test_output/src/
 23 
 24 echo "$(date) Running All Tests"
 25-for test_file in test_output/tests/*.js
 26+for test_file in test_output/tests/*.js test_output/tests/*/*.js
 27 do
 28-  echo "$(date) Running $test_file"
 29-  node $test_file
 30+  echo "$(date) Running ${test_file}"
 31+  node ${test_file}
 32 done
 33 echo "$(date) Tests Done"
 34\ No newline at end of file
 35diff --git a/tests/DateFormulasTest.ts b/tests/Formulas/DateFormulasTest.ts
 36similarity index 99%
 37rename from tests/DateFormulasTest.ts
 38rename to tests/Formulas/DateFormulasTest.ts
 39index 139858b..7877a48 100644
 40--- a/tests/DateFormulasTest.ts
 41+++ b/tests/Formulas/DateFormulasTest.ts
 42@@ -22,12 +22,12 @@ import {
 43   TIME,
 44   WORKDAY,
 45   WORKDAY$INTL
 46-} from "../src/Formulas/Date"
 47-import * as ERRORS from "../src/Errors"
 48+} from "../../src/Formulas/Date"
 49+import * as ERRORS from "../../src/Errors";
 50 import {
 51   assertEquals,
 52   catchAndAssertEquals
 53-} from "./utils/Asserts"
 54+} from "../utils/Asserts"
 55 
 56 
 57 // Test WORKDAY.INTL
 58diff --git a/tests/DateFormulasTestTimeOverride.ts b/tests/Formulas/DateFormulasTestTimeOverride.ts
 59similarity index 91%
 60rename from tests/DateFormulasTestTimeOverride.ts
 61rename to tests/Formulas/DateFormulasTestTimeOverride.ts
 62index 0ff7950..0dff4be 100644
 63--- a/tests/DateFormulasTestTimeOverride.ts
 64+++ b/tests/Formulas/DateFormulasTestTimeOverride.ts
 65@@ -2,12 +2,12 @@ import {
 66   NOW,
 67   DATEVALUE,
 68   TODAY
 69-} from "../src/Formulas/Date"
 70-import * as ERRORS from "../src/Errors"
 71+} from "../../src/Formulas/Date"
 72+import * as ERRORS from "../../src/Errors";
 73 import {
 74   assertEquals,
 75   catchAndAssertEquals
 76-} from "./utils/Asserts"
 77+} from "../utils/Asserts"
 78 
 79 
 80 // WARNING: Locking in Date by overriding prototypes.
 81diff --git a/tests/EngineeringTest.ts b/tests/Formulas/EngineeringTest.ts
 82similarity index 97%
 83rename from tests/EngineeringTest.ts
 84rename to tests/Formulas/EngineeringTest.ts
 85index e8c603c..132b5cd 100644
 86--- a/tests/EngineeringTest.ts
 87+++ b/tests/Formulas/EngineeringTest.ts
 88@@ -6,12 +6,12 @@ import {
 89   DEC2HEX,
 90   DEC2OCT,
 91   DELTA
 92-} from "../src/Formulas/Engineering";
 93-import * as ERRORS from "../src/Errors"
 94+} from "../../src/Formulas/Engineering";
 95+import * as ERRORS from "../../src/Errors";
 96 import {
 97   assertEquals,
 98   catchAndAssertEquals
 99-} from "./utils/Asserts"
100+} from "../utils/Asserts"
101 
102 
103 // Test BIN2DEC
104diff --git a/tests/FinancialTest.ts b/tests/Formulas/FinancialTest.ts
105similarity index 97%
106rename from tests/FinancialTest.ts
107rename to tests/Formulas/FinancialTest.ts
108index b245f6a..829d83f 100644
109--- a/tests/FinancialTest.ts
110+++ b/tests/Formulas/FinancialTest.ts
111@@ -8,18 +8,18 @@ import {
112   DOLLARDE,
113   DOLLARFR,
114   EFFECT
115-} from "../src/Formulas/Financial";
116+} from "../../src/Formulas/Financial";
117 import {
118   DATE
119-} from "../src/Formulas/Date";
120+} from "../../src/Formulas/Date";
121 import {
122   PI
123-} from "../src/Formulas/Math";
124-import * as ERRORS from "../src/Errors"
125+} from "../../src/Formulas/Math";
126+import * as ERRORS from "../../src/Errors";
127 import {
128   assertEquals,
129   catchAndAssertEquals
130-} from "./utils/Asserts";
131+} from "../utils/Asserts";
132 
133 // Test ACCRINT
134 assertEquals(ACCRINT(DATE(2000, 1, 1), DATE(2000, 2, 1), DATE(2002, 12, 31), 0.05, 100, 4), 14.98631386861314);
135diff --git a/tests/HelperTest.ts b/tests/Formulas/HelperTest.ts
136similarity index 88%
137rename from tests/HelperTest.ts
138rename to tests/Formulas/HelperTest.ts
139index c69491f..59a3921 100644
140--- a/tests/HelperTest.ts
141+++ b/tests/Formulas/HelperTest.ts
142@@ -1,5 +1,5 @@
143-import { Helpers } from "../src/Helpers";
144-import {assertEquals,} from "./utils/Asserts"
145+import { Helpers } from "../../src/Helpers";
146+import { assertEquals } from "../utils/Asserts"
147 
148 // Test Helpers.number
149 assertEquals(-1, Helpers.number("-1"));
150diff --git a/tests/LogicalTest.ts b/tests/Formulas/LogicalTest.ts
151similarity index 96%
152rename from tests/LogicalTest.ts
153rename to tests/Formulas/LogicalTest.ts
154index 04e8355..c26807f 100644
155--- a/tests/LogicalTest.ts
156+++ b/tests/Formulas/LogicalTest.ts
157@@ -6,12 +6,12 @@ import {
158   NOT,
159   OR,
160   XOR
161-} from "../src/Formulas/Logical";
162-import * as ERRORS from "../src/Errors"
163+} from "../../src/Formulas/Logical";
164+import * as ERRORS from "../../src/Errors";
165 import {
166   assertEquals,
167   catchAndAssertEquals
168-} from "./utils/Asserts";
169+} from "../utils/Asserts";
170 
171 
172 // Test AND
173diff --git a/tests/MathTest.ts b/tests/Formulas/MathTest.ts
174similarity index 99%
175rename from tests/MathTest.ts
176rename to tests/Formulas/MathTest.ts
177index f9e4824..aad5c1f 100644
178--- a/tests/MathTest.ts
179+++ b/tests/Formulas/MathTest.ts
180@@ -50,12 +50,12 @@ import {
181   RADIANS,
182   DEGREES,
183   COMBIN
184-} from "../src/Formulas/Math";
185-import * as ERRORS from "../src/Errors"
186+} from "../../src/Formulas/Math";
187+import * as ERRORS from "../../src/Errors";
188 import {
189   assertEquals,
190   catchAndAssertEquals
191-} from "./utils/Asserts";
192+} from "../utils/Asserts";
193 
194 
195 // Test ABS
196diff --git a/tests/StatisticalTest.ts b/tests/Formulas/StatisticalTest.ts
197similarity index 98%
198rename from tests/StatisticalTest.ts
199rename to tests/Formulas/StatisticalTest.ts
200index ef72b87..4f1c565 100644
201--- a/tests/StatisticalTest.ts
202+++ b/tests/Formulas/StatisticalTest.ts
203@@ -18,12 +18,12 @@ import {
204   MAXA,
205   MIN,
206   MINA
207-} from "../src/Formulas/Statistical";
208-import * as ERRORS from "../src/Errors"
209+} from "../../src/Formulas/Statistical";
210+import * as ERRORS from "../../src/Errors";
211 import {
212   assertEquals,
213   catchAndAssertEquals
214-} from "./utils/Asserts";
215+} from "../utils/Asserts";
216 
217 
218 // Test AVEDEV
219diff --git a/tests/TextTest.ts b/tests/Formulas/TextTest.ts
220similarity index 95%
221rename from tests/TextTest.ts
222rename to tests/Formulas/TextTest.ts
223index e7c8997..d3d60ab 100644
224--- a/tests/TextTest.ts
225+++ b/tests/Formulas/TextTest.ts
226@@ -5,13 +5,13 @@ import {
227   CONCATENATE,
228   SPLIT,
229   CONVERT
230-} from "../src/Formulas/Text";
231-import * as ERRORS from "../src/Errors";
232+} from "../../src/Formulas/Text";
233+import * as ERRORS from "../../src/Errors";
234 import {
235   assertEquals,
236   assertArrayEquals,
237   catchAndAssertEquals
238-} from "./utils/Asserts";
239+} from "../utils/Asserts";
240 
241 
242 // Test SPLIT