@tomei/mailer 0.7.1 → 0.8.1-test.1

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/jest.config.js CHANGED
@@ -3,7 +3,10 @@ module.exports = {
3
3
  clearMocks: true,
4
4
  preset: 'ts-jest',
5
5
  testTimeout: 20000,
6
+ collectCoverage: true,
6
7
  coverageDirectory: 'coverage',
8
+ coverageReporters: ['text', 'cobertura'],
7
9
  testEnvironment: 'node',
8
10
  modulePathIgnorePatterns: ['<rootDir>/dist'],
11
+ globals: { 'ts-jest': { diagnostics: false } },
9
12
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tomei/mailer",
3
- "version": "0.7.1",
3
+ "version": "0.8.1-test.1",
4
4
  "description": "Tomei Mailer Package",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -9,7 +9,7 @@
9
9
  "format": "prettier --write \"src/**/*.ts\"",
10
10
  "lint": "npx eslint . --fix",
11
11
  "test": "jest --forceExit --detectOpenHandles",
12
- "prepare": "husky"
12
+ "prepare": "husky install || true"
13
13
  },
14
14
  "author": "Tomei",
15
15
  "license": "ISC",
@@ -0,0 +1,32 @@
1
+ import { generateLogTransactionHTML } from './helpers';
2
+
3
+ describe('generateLogTransactionHTML', () => {
4
+ it('should return a string', () => {
5
+ const result = generateLogTransactionHTML({});
6
+ expect(typeof result).toBe('string');
7
+ });
8
+
9
+ it('should contain the intro paragraph text', () => {
10
+ const result = generateLogTransactionHTML({});
11
+ expect(result).toContain('data management practices');
12
+ expect(result).toContain('backup process');
13
+ });
14
+
15
+ it('should render a table row with key as bold label for each entry', () => {
16
+ const result = generateLogTransactionHTML({
17
+ systemCode: 'SSO',
18
+ tableName: 'users',
19
+ });
20
+ expect(result).toContain('<strong>systemCode</strong>');
21
+ expect(result).toContain('<p>SSO</p>');
22
+ expect(result).toContain('<strong>tableName</strong>');
23
+ expect(result).toContain('<p>users</p>');
24
+ });
25
+
26
+ it('should handle empty object and still include intro text', () => {
27
+ const result = generateLogTransactionHTML({});
28
+ expect(result).toContain('<table');
29
+ expect(result).toContain('</table>');
30
+ expect(result).not.toContain('<strong>');
31
+ });
32
+ });