@logue/reverb 1.4.2 → 1.4.3
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/README.md +60 -0
- package/package.json +28 -22
package/README.md
CHANGED
|
@@ -87,6 +87,66 @@ sourceNode.connect(ctx.destination);
|
|
|
87
87
|
sourceNode.play();
|
|
88
88
|
```
|
|
89
89
|
|
|
90
|
+
## Testing
|
|
91
|
+
|
|
92
|
+
This project includes a comprehensive test suite to ensure reliability and code quality.
|
|
93
|
+
|
|
94
|
+
### Test Coverage
|
|
95
|
+
|
|
96
|
+
- **Statement Coverage**: 100%
|
|
97
|
+
- **Function Coverage**: 100%
|
|
98
|
+
- **Branch Coverage**: 90.56%
|
|
99
|
+
- **Line Coverage**: 100%
|
|
100
|
+
|
|
101
|
+
### Test Structure
|
|
102
|
+
|
|
103
|
+
The test suite is organized into several categories:
|
|
104
|
+
|
|
105
|
+
- **Unit Tests**: Individual method and property testing
|
|
106
|
+
- `src/__tests__/Reverb.test.ts` - Main Reverb class tests
|
|
107
|
+
- `src/__tests__/NoiseType.test.ts` - Noise type definition tests
|
|
108
|
+
- `src/__tests__/OptionInterface.test.ts` - Configuration interface tests
|
|
109
|
+
|
|
110
|
+
- **Integration Tests**: Component interaction testing
|
|
111
|
+
- `src/__tests__/integration.test.ts` - Cross-component integration tests
|
|
112
|
+
|
|
113
|
+
- **End-to-End Tests**: Real-world usage scenarios
|
|
114
|
+
- `src/__tests__/e2e.test.ts` - Practical implementation scenarios
|
|
115
|
+
|
|
116
|
+
### Test Features
|
|
117
|
+
|
|
118
|
+
The test suite covers:
|
|
119
|
+
|
|
120
|
+
- ✅ Constructor with default and custom options
|
|
121
|
+
- ✅ Audio node connection and disconnection
|
|
122
|
+
- ✅ Parameter validation and error handling
|
|
123
|
+
- ✅ All reverb parameters (mix, time, decay, delay, reverse)
|
|
124
|
+
- ✅ Filter configurations (type, frequency, Q-factor)
|
|
125
|
+
- ✅ Noise algorithm variations (white, pink, brown, blue, violet, red, green)
|
|
126
|
+
- ✅ Performance testing with multiple instances
|
|
127
|
+
- ✅ Edge cases and boundary conditions
|
|
128
|
+
- ✅ Real-world scenarios (guitar, vocal, drum reverb settings)
|
|
129
|
+
|
|
130
|
+
### Running Tests
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
# Run all tests
|
|
134
|
+
pnpm test
|
|
135
|
+
|
|
136
|
+
# Run tests once
|
|
137
|
+
pnpm test:run
|
|
138
|
+
|
|
139
|
+
# Run tests with coverage report
|
|
140
|
+
pnpm test:coverage
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Test Environment
|
|
144
|
+
|
|
145
|
+
- **Vitest** - Fast Vite-based test framework
|
|
146
|
+
- **Happy-DOM** - Browser environment simulation
|
|
147
|
+
- **Web Audio API Mocking** - Complete audio context simulation
|
|
148
|
+
- **TypeScript Support** - Full type checking during tests
|
|
149
|
+
|
|
90
150
|
### CDN Usage
|
|
91
151
|
|
|
92
152
|
Not really intended for use with a CDN.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@logue/reverb",
|
|
4
|
-
"version": "1.4.
|
|
4
|
+
"version": "1.4.3",
|
|
5
5
|
"description": "JavaScript Reverb effect class",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"webaudio",
|
|
@@ -47,10 +47,10 @@
|
|
|
47
47
|
"./package.json": "./package.json"
|
|
48
48
|
},
|
|
49
49
|
"engines": {
|
|
50
|
-
"node": ">=22.0
|
|
51
|
-
"pnpm": ">=10.
|
|
50
|
+
"node": "^20.19.0 || >=22.12.0",
|
|
51
|
+
"pnpm": ">=10.2.0"
|
|
52
52
|
},
|
|
53
|
-
"packageManager": "pnpm@10.
|
|
53
|
+
"packageManager": "pnpm@10.18.3",
|
|
54
54
|
"sideEffects": false,
|
|
55
55
|
"scripts": {
|
|
56
56
|
"dev": "vite",
|
|
@@ -63,7 +63,10 @@
|
|
|
63
63
|
"build-only": "vite build",
|
|
64
64
|
"lint": "eslint . --fix --cache --cache-location ./node_modules/.vite/vite-plugin-eslint && prettier . --write",
|
|
65
65
|
"preview": "vite preview --mode=docs",
|
|
66
|
-
"prepare": "husky"
|
|
66
|
+
"prepare": "husky",
|
|
67
|
+
"test": "vitest",
|
|
68
|
+
"test:run": "vitest run",
|
|
69
|
+
"test:coverage": "vitest run --coverage"
|
|
67
70
|
},
|
|
68
71
|
"peerDependencies": {
|
|
69
72
|
"@thi.ng/colored-noise": "^1.0.103",
|
|
@@ -71,31 +74,34 @@
|
|
|
71
74
|
"@thi.ng/transducers": "^9.5.1"
|
|
72
75
|
},
|
|
73
76
|
"devDependencies": {
|
|
74
|
-
"@eslint/js": "^9.
|
|
77
|
+
"@eslint/js": "^9.38.0",
|
|
75
78
|
"@tsconfig/node-lts": "^22.0.2",
|
|
76
|
-
"@types/node": "^24.
|
|
77
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"eslint
|
|
79
|
+
"@types/node": "^24.8.1",
|
|
80
|
+
"@typescript-eslint/eslint-plugin": "^8.46.1",
|
|
81
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
82
|
+
"bootstrap": "^5.3.8",
|
|
83
|
+
"eslint": "^9.38.0",
|
|
84
|
+
"eslint-config-prettier": "^10.1.8",
|
|
81
85
|
"eslint-import-resolver-custom-alias": "^1.3.2",
|
|
82
86
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
83
87
|
"eslint-plugin-import": "^2.32.0",
|
|
84
|
-
"eslint-plugin-yaml": "^1.1.
|
|
85
|
-
"globals": "^16.
|
|
88
|
+
"eslint-plugin-yaml": "^1.1.3",
|
|
89
|
+
"globals": "^16.4.0",
|
|
90
|
+
"happy-dom": "^20.0.5",
|
|
86
91
|
"husky": "^9.1.7",
|
|
87
|
-
"jiti": "^2.
|
|
88
|
-
"lint-staged": "^16.
|
|
92
|
+
"jiti": "^2.6.1",
|
|
93
|
+
"lint-staged": "^16.2.4",
|
|
89
94
|
"npm-run-all2": "^8.0.4",
|
|
90
95
|
"prettier": "^3.6.2",
|
|
91
96
|
"rimraf": "^6.0.1",
|
|
92
|
-
"rollup-plugin-visualizer": "^6.0.
|
|
93
|
-
"typescript": "^5.
|
|
94
|
-
"typescript-eslint": "^8.
|
|
95
|
-
"vite": "^7.
|
|
97
|
+
"rollup-plugin-visualizer": "^6.0.5",
|
|
98
|
+
"typescript": "^5.9.3",
|
|
99
|
+
"typescript-eslint": "^8.46.1",
|
|
100
|
+
"vite": "^7.1.10",
|
|
96
101
|
"vite-plugin-banner": "^0.8.1",
|
|
97
|
-
"vite-plugin-checker": "^0.
|
|
98
|
-
"vite-plugin-dts": "^4.5.4"
|
|
102
|
+
"vite-plugin-checker": "^0.11.0",
|
|
103
|
+
"vite-plugin-dts": "^4.5.4",
|
|
104
|
+
"vitest": "^3.2.4"
|
|
99
105
|
},
|
|
100
106
|
"husky": {
|
|
101
107
|
"hooks": {
|
|
@@ -110,4 +116,4 @@
|
|
|
110
116
|
"json5": ">=2.2.3",
|
|
111
117
|
"yaml": ">=2.3.2"
|
|
112
118
|
}
|
|
113
|
-
}
|
|
119
|
+
}
|