vitest-pool-assemblyscript 0.6.1 → 0.6.2

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.
@@ -12,46 +12,50 @@ function arrayEquals<T extends ArrayLike<unknown>, U extends ArrayLike<unknown>>
12
12
  return true;
13
13
  }
14
14
 
15
- function setEquals<T extends Set<V>, U extends Set<V>, V>(actual: T, expected: U): bool {
16
- if (actual.size != expected.size) {
17
- return false;
18
- }
15
+ function setEquals<T, U>(actual: T, expected: U): bool {
16
+ if (actual instanceof Set && expected instanceof Set) {
17
+ if (actual.size != expected.size) {
18
+ return false;
19
+ }
19
20
 
20
- const expectedValues: V[] = expected.values();
21
+ const expectedValues = expected.values();
21
22
 
22
- for (let i = 0; i < expectedValues.length; i++) {
23
- if (!actual.has(expectedValues[i])) {
24
- return false;
23
+ for (let i = 0; i < expectedValues.length; i++) {
24
+ if (!actual.has(expectedValues[i])) {
25
+ return false;
26
+ }
25
27
  }
28
+
29
+ return true;
26
30
  }
27
31
 
28
- return true;
32
+ return false;
29
33
  }
30
34
 
31
- function mapEquals<
32
- T extends Map<V, W>,
33
- U extends Map<V, W>,
34
- V, W
35
- >(actual: T, expected: U): bool {
36
- if (actual.size != expected.size) {
37
- return false;
38
- }
39
-
40
- const expectedKeys: V[] = expected.keys();
41
-
42
- for (let i = 0; i < expectedKeys.length; i++) {
43
- const key: V = expectedKeys[i];
44
-
45
- if (!actual.has(key)) {
35
+ function mapEquals<T, U>(actual: T, expected: U): bool {
36
+ if (actual instanceof Map && expected instanceof Map) {
37
+ if (actual.size != expected.size) {
46
38
  return false;
47
39
  }
48
40
 
49
- if (!equals<W, W>(actual.get(key), expected.get(key))) {
50
- return false;
41
+ const expectedKeys = expected.keys();
42
+
43
+ for (let i = 0; i < expectedKeys.length; i++) {
44
+ const key = expectedKeys[i];
45
+
46
+ if (!actual.has(key)) {
47
+ return false;
48
+ }
49
+
50
+ if (!equals(actual.get(key), expected.get(key))) {
51
+ return false;
52
+ }
51
53
  }
54
+
55
+ return true;
52
56
  }
53
57
 
54
- return true;
58
+ return false;
55
59
  }
56
60
 
57
61
  /**
@@ -212,6 +216,12 @@ export function equals<T, U>(actual: T, expected: U): bool {
212
216
  return mapEquals(actual, expected);
213
217
  }
214
218
 
219
+ if (idof<T>() != idof<U>()) {
220
+ throw new Error("Cannot compare equality between " + nameof<T>(actual)
221
+ + " and " + nameof<U>(expected) + " - this comparison is undefined."
222
+ );
223
+ }
224
+
215
225
  // TODO value compare
216
226
  throw new Error("Deep equality comparison of user-defined reference types"
217
227
  + " is not yet implemented, and these references are not identical."
@@ -1,5 +1,5 @@
1
- import { AssemblyScriptPoolOptions, WasmImportsFactory, WasmImportsFactoryInfo } from "../types-CnJC7Ydg.mjs";
2
- import "../custom-provider-options-BZg2Trd5.mjs";
1
+ import { AssemblyScriptPoolOptions, WasmImportsFactory, WasmImportsFactoryInfo } from "../types-D0nprJo1.mjs";
2
+ import "../custom-provider-options-YTk1m7At.mjs";
3
3
  import { ConfigEnv, UserWorkspaceConfig, ViteUserConfig } from "vitest/config";
4
4
 
5
5
  //#region src/config/config-helpers-v3.d.ts
@@ -1,4 +1,4 @@
1
- import { AssemblyScriptPoolOptions, WasmImportsFactory, WasmImportsFactoryInfo } from "../types-CnJC7Ydg.mjs";
2
- import "../custom-provider-options-BZg2Trd5.mjs";
3
- import { createAssemblyScriptPool } from "../pool-runner-init-BLvrW28n.mjs";
1
+ import { AssemblyScriptPoolOptions, WasmImportsFactory, WasmImportsFactoryInfo } from "../types-D0nprJo1.mjs";
2
+ import "../custom-provider-options-YTk1m7At.mjs";
3
+ import { createAssemblyScriptPool } from "../pool-runner-init-CvnB0-iN.mjs";
4
4
  export { type AssemblyScriptPoolOptions, type WasmImportsFactory, type WasmImportsFactoryInfo, createAssemblyScriptPool };
@@ -1,4 +1,4 @@
1
- import { HybridProviderOptions } from "./types-CnJC7Ydg.mjs";
1
+ import { HybridProviderOptions } from "./types-D0nprJo1.mjs";
2
2
  import { CoverageV8Options } from "vitest/node";
3
3
 
4
4
  //#region src/config/custom-provider-options.d.ts
@@ -23,4 +23,4 @@ declare module "vitest/node" {
23
23
  customProviderModule: string;
24
24
  }
25
25
  }
26
- //# sourceMappingURL=custom-provider-options-BZg2Trd5.d.mts.map
26
+ //# sourceMappingURL=custom-provider-options-YTk1m7At.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"custom-provider-options-BZg2Trd5.d.mts","names":[],"sources":["../src/config/custom-provider-options.ts"],"mappings":";;;;;;AAE2C;;;;;;;;;;;;;YAiB/B,qBAAA,SAA8B,qBAAA,EAAuB,IAAA,CAAK,iBAAA;IAClE,QAAA;IAGD;IAAA,oBAAA;EAAA;AAAA"}
1
+ {"version":3,"file":"custom-provider-options-YTk1m7At.d.mts","names":[],"sources":["../src/config/custom-provider-options.ts"],"mappings":";;;;;;AAE2C;;;;;;;;;;;;;YAiB/B,qBAAA,SAA8B,qBAAA,EAAuB,IAAA,CAAK,iBAAA;IAClE,QAAA;IAGD;IAAA,oBAAA;EAAA;AAAA"}
@@ -1,4 +1,4 @@
1
- import { AssemblyScriptCompilerOptions, AssemblyScriptCompilerResult, AssemblyScriptPoolOptions } from "./types-CnJC7Ydg.mjs";
1
+ import { AssemblyScriptCompilerOptions, AssemblyScriptCompilerResult, AssemblyScriptPoolOptions } from "./types-D0nprJo1.mjs";
2
2
 
3
3
  //#region src/compiler/index.d.ts
4
4
  /**
package/dist/index.d.mts CHANGED
@@ -1,3 +1,3 @@
1
- import "./types-CnJC7Ydg.mjs";
2
- import { createAssemblyScriptPool } from "./pool-runner-init-BLvrW28n.mjs";
1
+ import "./types-D0nprJo1.mjs";
2
+ import { createAssemblyScriptPool } from "./pool-runner-init-CvnB0-iN.mjs";
3
3
  export { createAssemblyScriptPool };
@@ -1,8 +1,8 @@
1
- import { AssemblyScriptPoolOptions } from "./types-CnJC7Ydg.mjs";
1
+ import { AssemblyScriptPoolOptions } from "./types-D0nprJo1.mjs";
2
2
  import { PoolRunnerInitializer } from "vitest/node";
3
3
 
4
4
  //#region src/pool/pool-runner-init.d.ts
5
5
  declare function createAssemblyScriptPool(userPoolOptions?: AssemblyScriptPoolOptions): PoolRunnerInitializer;
6
6
  //#endregion
7
7
  export { createAssemblyScriptPool };
8
- //# sourceMappingURL=pool-runner-init-BLvrW28n.d.mts.map
8
+ //# sourceMappingURL=pool-runner-init-CvnB0-iN.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pool-runner-init-CvnB0-iN.d.mts","names":[],"sources":["../src/pool/pool-runner-init.ts"],"mappings":";;;;iBAUgB,wBAAA,CAAyB,eAAA,GAAkB,yBAAA,GAA4B,qBAAA"}
@@ -1,4 +1,4 @@
1
- import { RunCompileAndDiscoverTask, ThreadSpec } from "../types-CnJC7Ydg.mjs";
1
+ import { RunCompileAndDiscoverTask, ThreadSpec } from "../types-D0nprJo1.mjs";
2
2
 
3
3
  //#region src/pool-thread/compile-worker-thread.d.ts
4
4
  declare function runCompileAndDiscoverSpec(data: RunCompileAndDiscoverTask): Promise<ThreadSpec>;
@@ -1,4 +1,4 @@
1
- import { RunTestsTask } from "../types-CnJC7Ydg.mjs";
1
+ import { RunTestsTask } from "../types-D0nprJo1.mjs";
2
2
 
3
3
  //#region src/pool-thread/test-worker-thread.d.ts
4
4
  declare function runFileSpec(data: RunTestsTask): Promise<void>;
@@ -1,4 +1,4 @@
1
- import { ProcessPoolRunFileTask } from "../types-CnJC7Ydg.mjs";
1
+ import { ProcessPoolRunFileTask } from "../types-D0nprJo1.mjs";
2
2
 
3
3
  //#region src/pool-thread/v3-tinypool-thread.d.ts
4
4
  declare function runTestFile(taskData: ProcessPoolRunFileTask): Promise<void>;
@@ -1,7 +1,6 @@
1
1
  import "tinyrainbow";
2
2
  import { MessagePort } from "node:worker_threads";
3
3
  import "birpc";
4
- import "vitest/node";
5
4
  import "@vitest/utils";
6
5
  import { SerializedConfig } from "vitest";
7
6
  import { File, Test } from "@vitest/runner/types";
@@ -235,4 +234,4 @@ interface ProcessPoolRunFileTask {
235
234
  }
236
235
  //#endregion
237
236
  export { AssemblyScriptCompilerOptions, AssemblyScriptCompilerResult, AssemblyScriptPoolOptions, HybridProviderOptions, ProcessPoolRunFileTask, RunCompileAndDiscoverTask, RunTestsTask, ThreadSpec, WasmImportsFactory, WasmImportsFactoryInfo };
238
- //# sourceMappingURL=types-CnJC7Ydg.d.mts.map
237
+ //# sourceMappingURL=types-D0nprJo1.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-D0nprJo1.d.mts","names":[],"sources":["../src/types/types.ts"],"mappings":";;;;;;;;;;;UAsEiB,yBAAA;;EAEf,KAAA;EACA,WAAA;EACA,oBAAA;EAuEF;EApEE,wBAAA;;;;;;;;;AA2IF;EAhIE,WAAA;;;;;;;;EASA,YAAA;EAEA,0BAAA;EACA,sBAAA;EAEA,sBAAA;EACA,kBAAA;EAEA,kBAAA;EAEA,kBAAA;AAAA;;;;UAMe,qBAAA;EACf,QAAA;EACA,oBAAA;EAEA,aAAA;EAgHA;AAGF;;;;;;;EAzGE,qBAAA;;;;;;EAOA,qBAAA;AAAA;AAAA,UAGe,sBAAA;EACf,MAAA,EAAQ,WAAA,CAAY,MAAA;EACpB,MAAA,EAAQ,WAAA,CAAY,MAAA;EACpB,KAAA;IACE,UAAA,GAAa,SAAA;EAAA;AAAA;AAAA,KAIL,kBAAA,IAAsB,UAAA,EAAY,sBAAA,KAA2B,WAAA,CAAY,OAAA;AAAA,UAuEpE,6BAAA;EACf,gBAAA;EACA,WAAA;EACA,sBAAA,GAAyB,sBAAA;EACzB,WAAA;EACA,UAAA;AAAA;AAAA,UAGe,4BAAA;EACf,MAAA,EAAQ,UAAA;EACR,SAAA;EACA,SAAA,GAAY,eAAA;EACZ,cAAA;EACA,aAAA;AAAA;AAAA,UAGe,sBAAA;;EAEf,WAAA;;EAEA,qBAAA;EACA,yBAAA;EACA,sBAAA;EACA,sBAAA;EACA,iCAAA;EACA,KAAA;AA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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vitest-pool-assemblyscript",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "description": "AssemblyScript testing with Vitest - Simple, fast, familiar, AS-native, with full coverage output",
5
5
  "author": "Matt Ritter <matthew.d.ritter@gmail.com>",
6
6
  "license": "MIT",
@@ -1 +0,0 @@
1
- {"version":3,"file":"pool-runner-init-BLvrW28n.d.mts","names":[],"sources":["../src/pool/pool-runner-init.ts"],"mappings":";;;;iBAUgB,wBAAA,CAAyB,eAAA,GAAkB,yBAAA,GAA4B,qBAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"types-CnJC7Ydg.d.mts","names":[],"sources":["../src/types/types.ts"],"mappings":";;;;;;;;;;;;UAsEiB,yBAAA;;EAEf,KAAA;EACA,WAAA;EACA,oBAAA;EAmEe;EAhEf,wBAAA;EAoEU;;;;;;;;;EAzDV,WAAA;EAgIe;;;;;;;EAvHf,YAAA;EAEA,0BAAA;EACA,sBAAA;EAEA,sBAAA;EACA,kBAAA;EAEA,kBAAA;EAEA,kBAAA;AAAA;;;;UAMe,qBAAA;EACf,QAAA;EACA,oBAAA;EAEA,aAAA;;;AAmHF;;;;;;EAzGE,qBAAA;;;;;;EAOA,qBAAA;AAAA;AAAA,UAGe,sBAAA;EACf,MAAA,EAAQ,WAAA,CAAY,MAAA;EACpB,MAAA,EAAQ,WAAA,CAAY,MAAA;EACpB,KAAA;IACE,UAAA,GAAa,SAAA;EAAA;AAAA;AAAA,KAIL,kBAAA,IAAsB,UAAA,EAAY,sBAAA,KAA2B,WAAA,CAAY,OAAA;AAAA,UAuEpE,6BAAA;EACf,gBAAA;EACA,WAAA;EACA,sBAAA,GAAyB,sBAAA;EACzB,WAAA;EACA,UAAA;AAAA;AAAA,UAGe,4BAAA;EACf,MAAA,EAAQ,UAAA;EACR,SAAA;EACA,SAAA,GAAY,eAAA;EACZ,cAAA;EACA,aAAA;AAAA;AAAA,UAGe,s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