@karpeleslab/klbfw 0.2.0 → 0.2.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 (42) hide show
  1. package/fw-wrapper.js +21 -3
  2. package/index.d.ts +81 -0
  3. package/index.js +1 -1
  4. package/internal.js +19 -6
  5. package/package.json +8 -1
  6. package/CLAUDE.md +0 -50
  7. package/coverage/clover.xml +0 -835
  8. package/coverage/coverage-final.json +0 -9
  9. package/coverage/lcov-report/base.css +0 -224
  10. package/coverage/lcov-report/block-navigation.js +0 -87
  11. package/coverage/lcov-report/cookies.js.html +0 -334
  12. package/coverage/lcov-report/favicon.png +0 -0
  13. package/coverage/lcov-report/fw-wrapper.js.html +0 -163
  14. package/coverage/lcov-report/index.html +0 -131
  15. package/coverage/lcov-report/index.js.html +0 -196
  16. package/coverage/lcov-report/internal.js.html +0 -604
  17. package/coverage/lcov-report/klbfw/cookies.js.html +0 -490
  18. package/coverage/lcov-report/klbfw/fw-wrapper.js.html +0 -745
  19. package/coverage/lcov-report/klbfw/index.html +0 -206
  20. package/coverage/lcov-report/klbfw/index.js.html +0 -235
  21. package/coverage/lcov-report/klbfw/internal.js.html +0 -811
  22. package/coverage/lcov-report/klbfw/rest.js.html +0 -565
  23. package/coverage/lcov-report/klbfw/test/index.html +0 -116
  24. package/coverage/lcov-report/klbfw/test/setup.js.html +0 -1105
  25. package/coverage/lcov-report/klbfw/upload.js.html +0 -3487
  26. package/coverage/lcov-report/klbfw/util.js.html +0 -388
  27. package/coverage/lcov-report/prettify.css +0 -1
  28. package/coverage/lcov-report/prettify.js +0 -2
  29. package/coverage/lcov-report/rest.js.html +0 -472
  30. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  31. package/coverage/lcov-report/sorter.js +0 -196
  32. package/coverage/lcov-report/upload.js.html +0 -1789
  33. package/coverage/lcov-report/util.js.html +0 -313
  34. package/coverage/lcov.info +0 -1617
  35. package/test/README.md +0 -62
  36. package/test/api.test.js +0 -102
  37. package/test/cookies.test.js +0 -65
  38. package/test/integration.test.js +0 -481
  39. package/test/rest.test.js +0 -93
  40. package/test/setup.js +0 -341
  41. package/test/upload.test.js +0 -689
  42. package/test/util.test.js +0 -46
package/test/util.test.js DELETED
@@ -1,46 +0,0 @@
1
- 'use strict';
2
-
3
- const util = require('../util');
4
- const { setupSSRMode, setupClientMode, resetMocks } = require('./setup');
5
-
6
- describe('Utility Module', () => {
7
- beforeEach(() => {
8
- resetMocks();
9
-
10
- // Mock fetch response for i18n calls
11
- global.fetch = jest.fn().mockImplementation(() => {
12
- return Promise.resolve({
13
- ok: true,
14
- status: 200,
15
- json: jest.fn().mockResolvedValue({
16
- "hello": "Hello",
17
- "goodbye": "Goodbye"
18
- })
19
- });
20
- });
21
- });
22
-
23
- describe('getI18N', () => {
24
- test('fetches locale data with specified language', async () => {
25
- const i18n = await util.getI18N('en-US');
26
- expect(fetch).toHaveBeenCalledWith('/_special/locale/en-US.json');
27
- expect(i18n).toHaveProperty('hello', 'Hello');
28
- });
29
-
30
- test('uses FW.Locale if no language specified', async () => {
31
- // FW.Locale is set to en-US in setup
32
- const i18n = await util.getI18N();
33
- expect(fetch).toHaveBeenCalledWith('/_special/locale/en-US.json');
34
- expect(i18n).toHaveProperty('hello', 'Hello');
35
- });
36
- });
37
-
38
- describe('Utility Functions', () => {
39
- test('trimPrefix processes URL correctly', () => {
40
- const result = util.trimPrefix('/l/en-US/path');
41
- expect(result).toHaveLength(2);
42
- expect(result[0]).toHaveProperty('l', 'en-US');
43
- expect(result[1]).toBe('/path');
44
- });
45
- });
46
- });