@ianmenethil/zp-devicefp 0.1.0 → 0.2.0

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/docs/testing.md CHANGED
@@ -1,32 +1,54 @@
1
- # Testing
2
-
3
- The project uses Node 24's built-in TypeScript execution and test runner.
4
-
5
- ## Coverage intent
6
-
7
- The included tests focus on:
8
-
9
- - deterministic canonicalization
10
- - stable hashing
11
- - anomaly scoring
12
- - storage and WebRTC collector behavior
13
- - audio and media-device collector behavior
14
- - client sync collection
15
- - parallel async collection
16
- - abort and timeout paths
17
- - warning isolation between runs
18
- - upload plumbing
19
- - built-artifact smoke loading
20
-
21
- ## Run locally
22
-
23
- ```bash
24
- node --test ./tests/**/*.test.ts
25
- node ./scripts/build.mjs
26
- ```
27
-
28
- ## Suggested next expansion
29
-
30
- - Add browser-matrix tests in Playwright for Chromium, Firefox, and WebKit.
31
- - Add snapshot tests for collector outputs in privacy-hardened environments.
32
- - Add server-side reconciliation tests once an API consumer is introduced.
1
+ # Testing
2
+
3
+ The project uses **bun test** (`bun test --coverage`) as its test runner. Tests are written in TypeScript with bun's built-in test module.
4
+
5
+ ## Current coverage
6
+
7
+ 92 tests across 24 files, 94.9% line coverage, 82.3% function coverage.
8
+
9
+ ```
10
+ All files | 82.26% funcs | 94.92% lines
11
+ ```
12
+
13
+ ## Coverage intent
14
+
15
+ The included tests focus on:
16
+
17
+ - deterministic canonicalization
18
+ - stable hashing
19
+ - anomaly scoring
20
+ - storage and WebRTC collector behavior
21
+ - audio and media-device collector behavior
22
+ - client sync collection
23
+ - parallel async collection
24
+ - abort and timeout paths
25
+ - warning isolation between runs
26
+ - built-artifact smoke loading
27
+
28
+ ## Test layout
29
+
30
+ ```
31
+ tests/
32
+ ├── unit/ # Unit tests (antiSpoof, canonicalize, hash, events, browser)
33
+ ├── integration/ # Client orchestration tests (collect, collectSync, events)
34
+ └── signals/ # Collector tests (21 signal test files)
35
+ ```
36
+
37
+ ## Run locally
38
+
39
+ ```bash
40
+ # Run tests
41
+ bun test
42
+
43
+ # Run tests with coverage
44
+ bun test --coverage
45
+
46
+ # Run the full build pipeline (lint → typecheck → knip → jscpd → tests → esbuild → CDN)
47
+ bun run build
48
+ ```
49
+
50
+ ## Suggested next expansion
51
+
52
+ - Add browser-matrix tests in Playwright for Chromium, Firefox, and WebKit.
53
+ - Add snapshot tests for collector outputs in privacy-hardened environments.
54
+ - Add server-side reconciliation tests once an API consumer is introduced.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ianmenethil/zp-devicefp",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Async-first browser and device fingerprinting library with explainable signals and anomaly scoring.",
5
5
  "type": "module",
6
6
  "main": "./dist/npm/index.cjs",
@@ -26,12 +26,12 @@
26
26
  "bun": ">=1.3.0",
27
27
  "node": ">=22"
28
28
  },
29
- "prepublishOnly": "bun run build",
30
29
  "scripts": {
30
+ "prepublishOnly": "bun run build",
31
31
  "build": "bun run check && bun run test:coverage && bun -e \"await import('./.scripts/build.ts')\"",
32
32
  "test": "bun test",
33
33
  "test:coverage": "bun test --coverage",
34
- "release": "sh -c 'V=$(npm version \"${1:-minor}\" -m \"chore: release %s\" | tail -1 | sed s/v//) && bun publish --access public && rm -rf \"F:/_ZP-Main/apps/CDN-server/public/devicefp\" && mkdir -p \"F:/_ZP-Main/apps/CDN-server/public/devicefp/$V\" && cp -r dist/cdn/* \"F:/_ZP-Main/apps/CDN-server/public/devicefp/$V/\" && mkdir -p \"F:/_ZP-Main/apps/CDN-server/public/devicefp/latest\" && cp -r dist/cdn/* \"F:/_ZP-Main/apps/CDN-server/public/devicefp/latest/\" && git push --follow-tags' --",
34
+ "release": "sh -c 'npm version \"${1:-minor}\" -m \"chore: release %s\" && bun publish --access public && rm -rf \"F:/_ZP-Main/apps/CDN-server/public/devicefp\" && mkdir -p \"F:/_ZP-Main/apps/CDN-server/public/devicefp\" && cp -r dist/cdn/* \"F:/_ZP-Main/apps/CDN-server/public/devicefp/\" && git push --follow-tags' --",
35
35
  "release:minor": "bun run release minor",
36
36
  "release:patch": "bun run release patch",
37
37
  "release:major": "bun run release major",