solid-logic 1.3.14-fd51b121 → 1.3.15-599d981c

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 (39) hide show
  1. package/.github/workflows/ci.yml +0 -1
  2. package/.nvmrc +1 -0
  3. package/jest.config.js +1 -1
  4. package/lib/authn/SolidAuthnLogic.js +1 -1
  5. package/lib/authn/SolidAuthnLogic.js.map +1 -1
  6. package/lib/discovery/discoveryLogic.d.ts +40 -0
  7. package/lib/discovery/discoveryLogic.d.ts.map +1 -0
  8. package/lib/discovery/discoveryLogic.js +494 -0
  9. package/lib/discovery/discoveryLogic.js.map +1 -0
  10. package/lib/inbox/InboxLogic.js +2 -2
  11. package/lib/inbox/InboxLogic.js.map +1 -1
  12. package/lib/index.d.ts +1 -0
  13. package/lib/index.d.ts.map +1 -1
  14. package/lib/index.js +7 -1
  15. package/lib/index.js.map +1 -1
  16. package/lib/logic/SolidLogic.d.ts +2 -3
  17. package/lib/logic/SolidLogic.d.ts.map +1 -1
  18. package/lib/logic/SolidLogic.js +42 -41
  19. package/lib/logic/SolidLogic.js.map +1 -1
  20. package/lib/typeIndex/typeIndexLogic.d.ts +4 -4
  21. package/lib/typeIndex/typeIndexLogic.d.ts.map +1 -1
  22. package/lib/typeIndex/typeIndexLogic.js +93 -31
  23. package/lib/typeIndex/typeIndexLogic.js.map +1 -1
  24. package/lib/util/UtilityLogic.d.ts +2 -2
  25. package/lib/util/UtilityLogic.d.ts.map +1 -1
  26. package/lib/util/UtilityLogic.js +6 -6
  27. package/lib/util/UtilityLogic.js.map +1 -1
  28. package/package.json +13 -13
  29. package/src/authn/SolidAuthnLogic.ts +5 -5
  30. package/src/discovery/discoveryLogic.ts +311 -0
  31. package/src/inbox/InboxLogic.ts +2 -2
  32. package/src/index.ts +10 -0
  33. package/src/logic/SolidLogic.ts +31 -32
  34. package/src/typeIndex/typeIndexLogic.ts +92 -61
  35. package/src/util/UtilityLogic.ts +8 -8
  36. package/test/chatLogic.test.ts +1 -1
  37. package/test/discoveryLogic.test.ts +740 -0
  38. package/test/helpers/setup.ts +3 -0
  39. package/test/typeIndexLogic.test.ts +9 -7
@@ -1,5 +1,8 @@
1
1
  import { error, log, trace, warn } from '../../src/util/debug'
2
2
  import fetchMock from "jest-fetch-mock";
3
+ import { TextEncoder, TextDecoder } from 'util'
4
+ global.TextEncoder = TextEncoder
5
+ global.TextDecoder = TextDecoder
3
6
 
4
7
  fetchMock.enableMocks();
5
8
  // We don't want to output debug messages to console as part of the tests
@@ -6,21 +6,23 @@ describe('loadTypeIndexes', () => {
6
6
  it('exists', () => {
7
7
  expect(typeIndexLogic.loadTypeIndexes).toBeInstanceOf(Function)
8
8
  })
9
- it('runs', () => {
10
- expect(typeIndexLogic.loadTypeIndexes({})).toBeInstanceOf(Object)
9
+ it.skip('runs', async () => {
10
+ const result = await typeIndexLogic.loadTypeIndexes({})
11
+ expect(result).toBeInstanceOf(Object)
11
12
  })
12
13
  })
13
14
 
14
- describe('registerInTypeIndex', () => {
15
+ describe('registerInTypeIndex', () => {
15
16
  it('exists', () => {
16
17
  expect(typeIndexLogic.registerInTypeIndex).toBeInstanceOf(Function)
17
18
  })
18
- it.skip('runs', async () => {
19
- expect(await typeIndexLogic.registerInTypeIndex(
19
+ it('throws error', async () => {
20
+ expect(typeIndexLogic.registerInTypeIndex(
20
21
  {} as AuthenticationContext,
21
22
  sym('https://test.test#'),
22
23
  sym('https://test.test#'),
23
24
  false
24
- )).toEqual(undefined)
25
+ )).rejects
26
+ .toThrow('@@ ensureLoadedPreferences: no user specified')
25
27
  })
26
- })
28
+ })