@digitaldefiance/express-suite-test-utils 1.1.0 → 1.1.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.
Files changed (2) hide show
  1. package/README.md +64 -0
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -297,6 +297,45 @@ describe('Database Tests', () => {
297
297
  4. **Test error conditions** with `toThrowType` matcher
298
298
  5. **Capture console output** when testing logging behavior
299
299
 
300
+ ### i18n Test Setup
301
+
302
+ Initialize i18n engines for testing error messages and translations:
303
+
304
+ ```typescript
305
+ import { setupI18nForTests } from '@digitaldefiance/express-suite-test-utils';
306
+
307
+ describe('Service Tests', () => {
308
+ let cleanupI18n: () => void;
309
+
310
+ beforeAll(() => {
311
+ // Initializes all available i18n engines (suite-core, ecies, node-ecies)
312
+ cleanupI18n = setupI18nForTests();
313
+ });
314
+
315
+ afterAll(() => {
316
+ cleanupI18n();
317
+ });
318
+
319
+ it('should throw translated error', async () => {
320
+ // Error classes now have i18n translations available
321
+ await expect(service.doSomething()).rejects.toBeInstanceOf(SomeError);
322
+ });
323
+ });
324
+ ```
325
+
326
+ For selective initialization:
327
+
328
+ ```typescript
329
+ import { setupSpecificI18nForTests } from '@digitaldefiance/express-suite-test-utils';
330
+
331
+ beforeAll(() => {
332
+ // Only initialize specific engines
333
+ cleanupI18n = setupSpecificI18nForTests(['suite-core', 'ecies']);
334
+ });
335
+ ```
336
+
337
+ **Note:** This helper dynamically loads i18n libraries if available. No hard dependencies are required - it gracefully skips any libraries not installed in your project.
338
+
300
339
  ### Cross-Package Testing
301
340
 
302
341
  These utilities are designed to work seamlessly with all Express Suite packages:
@@ -341,6 +380,31 @@ MIT
341
380
 
342
381
  ## ChangeLog
343
382
 
383
+ ### v2.1.37
384
+
385
+ - Version sync tag (out of sequence with v1.x line). Removed mongoose, i18n, and direct-log modules; stripped peer dependencies. Package version reset to 1.0.7 in package.json.
386
+
387
+ ### v1.1.1
388
+
389
+ - Add `createI18nSetup` factory integration tests covering full monorepo dependency chain
390
+ - README and jest config updates
391
+
392
+ ### v1.1.0
393
+
394
+ - Add `setupI18nForTests()` helper for initializing i18n engines in tests
395
+ - Add `setupSpecificI18nForTests()` for selective engine initialization
396
+ - Uses dynamic loading to avoid dependency cycles
397
+
398
+ ### v1.0.14
399
+
400
+ - Increase MongoMemoryServer launch timeout for slow CI environments
401
+
402
+ ### v1.0.13
403
+
404
+ - ESLint config and code style cleanup (trailing commas, whitespace, `any` → `unknown`)
405
+ - Add `@typescript-eslint/no-namespace` eslint-disable comments for jest global declarations
406
+ - Dependency updates
407
+
344
408
  ### v1.0.11
345
409
 
346
410
  - Fix mongoose to use @digitaldefiance/mongoose-types
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digitaldefiance/express-suite-test-utils",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "homepage": "https://github.com/Digital-Defiance/test-utils",
5
5
  "repository": {
6
6
  "type": "git",
@@ -49,14 +49,14 @@
49
49
  "mongoose": "^8.0.0"
50
50
  },
51
51
  "peerDependenciesMeta": {
52
- "@digitaldefiance/suite-core-lib": {
53
- "optional": true
54
- },
55
52
  "@digitaldefiance/ecies-lib": {
56
53
  "optional": true
57
54
  },
58
55
  "@digitaldefiance/node-ecies-lib": {
59
56
  "optional": true
57
+ },
58
+ "@digitaldefiance/suite-core-lib": {
59
+ "optional": true
60
60
  }
61
61
  },
62
62
  "devDependencies": {