spreadsheet
typeScript/javascript spreadsheet parser, with formulas.
git clone https://git.vogt.world/spreadsheet.git
Log | Files | README.md
← Commit log
commit
message
Adding a test.sh script to compile and run tests.
author
Ben Vogt <[email protected]>
date
2016-12-29 21:22:03
stats
3 file(s) changed, 18 insertions(+), 1 deletions(-)
files
package.json
tests.sh
tests/CellTest.ts
 1diff --git a/package.json b/package.json
 2index 5a13261..6f98f8a 100644
 3--- a/package.json
 4+++ b/package.json
 5@@ -4,7 +4,7 @@
 6   "description": "TypeScript implementation of a spreadsheet.",
 7   "scripts": {
 8     "build": "tsc && cp lib/parser.js output/",
 9-    "test": "tsc --outDir test_output tests/*.ts && node test_output/tests/*.js && echo Tests Pass"
10+    "test": "tsc --outDir test_output tests/*.ts && "
11   },
12   "author": "vogtb <bvogt at gmail.com>",
13   "license": "MIT",
14diff --git a/tests.sh b/tests.sh
15new file mode 100755
16index 0000000..588d0f1
17--- /dev/null
18+++ b/tests.sh
19@@ -0,0 +1,12 @@
20+#!/bin/bash
21+
22+echo "$(date) Compiling Tests"
23+tsc --outDir test_output tests/*.ts
24+
25+echo "$(date) Running All Tests"
26+for test_file in test_output/tests/*.js
27+do
28+  echo "$(date) Running $test_file"
29+  node $test_file
30+done
31+echo "$(date) Tests Done"
32\ No newline at end of file
33diff --git a/tests/CellTest.ts b/tests/CellTest.ts
34index 44b733e..2a4dbbb 100644
35--- a/tests/CellTest.ts
36+++ b/tests/CellTest.ts
37@@ -15,3 +15,8 @@ one.updateDependencies(["B2", "C1", "D12", "D13"]);
38 assertArrayEquals(one.dependencies, ["B2", "C1", "D12", "D13"]);
39 one.updateDependencies(["M4"]);
40 assertArrayEquals(one.dependencies, ["B2", "C1", "D12", "D13", "M4"]);
41+
42+//Test setValue
43+var v = new Cell("0", "A1");
44+v.setValue("100");
45+assertEquals("100", v.value);