as-test 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -10,4 +10,5 @@ v0.0.9 - Fix type issue
10
10
 
11
11
  v0.1.0 - Fix more type issues
12
12
  v0.1.1 - Add code coverage!
13
- v0.1.2 - Fix bugs with globals and dependencies
13
+ v0.1.2 - Fix bugs with globals and dependencies
14
+ v0.1.3 - Revamp `log<T>(data: T)` with new as-console version
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  | _ || __| ___|_ _|| __|| __||_ _|
4
4
  | ||__ ||___| | | | __||__ | | |
5
5
  |__|__||_____| |_| |_____||_____| |_|
6
- v0.1.1
6
+ v0.1.4
7
7
  </pre>
8
8
  </h5>
9
9
 
@@ -135,7 +135,7 @@ Tests: 0 failed, 8 total
135
135
  Coverage: 0 failed, 23 total
136
136
  Snapshots: 0 total
137
137
  Time: 101.812μs
138
- </pre>
138
+ </pre>z
139
139
  </h6>
140
140
 
141
141
  ## Running
package/assembly/index.ts CHANGED
@@ -2,8 +2,9 @@ import { rainbow } from "as-rainbow";
2
2
  import { TestGroup } from "./src/group";
3
3
  import { Expectation } from "./src/expectation";
4
4
  import { formatTime } from "./util";
5
- import { stringify } from "as-console/assembly";
5
+ import { stringify } from "as-console/stringify";
6
6
  import { __COVER, __HASHES, __POINTS } from "as-test/assembly/coverage";
7
+ import { createTable } from "table-as";
7
8
 
8
9
  /**
9
10
  * Enumeration representing the verdict of a test case.
@@ -213,7 +214,7 @@ export function run(options: RunOptions = new RunOptions()): void {
213
214
  console.log(rainbow.boldMk(rainbow.blueBright(`| _ || __| ___|_ _|| __|| __||_ _|`)));
214
215
  console.log(rainbow.boldMk(rainbow.blueBright(`| ||__ ||___| | | | __||__ | | | `)));
215
216
  console.log(rainbow.boldMk(rainbow.blueBright(`|__|__||_____| |_| |_____||_____| |_| `)));
216
- console.log(rainbow.dimMk("\n------------------- v0.1.1 -------------------\n"));
217
+ console.log(rainbow.dimMk("\n------------------- v0.1.4 -------------------\n"));
217
218
  if (options.coverage) {
218
219
  console.log(rainbow.bgBlueBright(" PLUGIN ") + " " + rainbow.dimMk("Using Code Coverage") + "\n");
219
220
  }
@@ -268,11 +269,19 @@ export function run(options: RunOptions = new RunOptions()): void {
268
269
  console.log(rainbow.dimMk("----------------- [COVERAGE] -----------------\n"));
269
270
  const points = __HASHES().values();
270
271
 
272
+ const table: string[][] = [
273
+ ["Location", "Type", "Hash"]
274
+ ];
275
+
271
276
  for (let i = 0; i < points.length; i++) {
272
277
  const point = unchecked(points[i]);
273
- console.log(rainbow.bgRed(" UNCOVERED ") + " " + point.type + " at " + point.file + ":" + point.line.toString() + ":" + point.column.toString());
278
+ const file = point.file;
279
+ const reference = point.file + ":" + point.line.toString() + ":" + point.column.toString();
280
+ const type = point.type;
281
+ const hash = point.hash;
282
+ table.push([rainbow.underlineMk(reference), type, "#" + hash]);
274
283
  }
275
- console.log("");
284
+ console.log(rainbow.dimMk(createTable(table)) + "\n");
276
285
  }
277
286
 
278
287
  console.log(rainbow.dimMk("----------------- [RESULTS] ------------------\n"));
@@ -282,7 +291,6 @@ export function run(options: RunOptions = new RunOptions()): void {
282
291
  if (options.coverage) console.log(rainbow.boldMk("Coverage: ") + (__HASHES().size ? rainbow.boldMk(rainbow.red(__HASHES().size.toString() + " failed")) : rainbow.boldMk(rainbow.green("0 failed"))) + ", " + __POINTS().toString() + " total");
283
292
  console.log(rainbow.boldMk("Snapshots: ") + "0 total");
284
293
  console.log(rainbow.boldMk("Time: ") + formatTime(ms));
285
- __COVER("joe mom")
286
294
  if (failed) {
287
295
  process.exit(1);
288
296
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "as-test",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Testing framework for AssemblyScript. Compatible with WASI or Bindings ",
5
5
  "types": "assembly/index.ts",
6
6
  "author": "Jairus Tanaka",
@@ -17,20 +17,21 @@
17
17
  "as-test": "./",
18
18
  "@assemblyscript/wasi-shim": "^0.1.0",
19
19
  "@types/micromatch": "^4.0.7",
20
- "assemblyscript": "^0.27.22",
20
+ "assemblyscript": "^0.27.28",
21
21
  "assemblyscript-prettier": "^3.0.1",
22
22
  "jest": "^29.7.0",
23
- "typescript": "^5.3.3",
23
+ "typescript": "^5.5.2",
24
24
  "visitor-as": "^0.11.4",
25
- "json-as": "^0.9.6"
25
+ "json-as": "^0.9.8"
26
26
  },
27
27
  "dependencies": {
28
- "as-console": "^6.0.2",
28
+ "as-console": "^1.0.1",
29
29
  "as-rainbow": "^0.1.0",
30
30
  "as-string-sink": "^0.5.3",
31
31
  "as-variant": "^0.4.1",
32
32
  "chalk": "^5.3.0",
33
- "micromatch": "^4.0.7"
33
+ "micromatch": "^4.0.7",
34
+ "table-as": "^1.0.1"
34
35
  },
35
36
  "overrides": {
36
37
  "assemblyscript": "$assemblyscript",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@as-test/transform",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Testing framework for AssemblyScript. Compatible with WASI or Bindings ",
5
5
  "main": "./lib/index.js",
6
6
  "author": "Jairus Tanaka",