@baukit/notifications-expo 0.18.3 → 0.19.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baukit/notifications-expo",
3
- "version": "0.18.3",
3
+ "version": "0.19.1",
4
4
  "description": "Optional expo-notifications adapter for @baukit/notifications-core that replaces only notifications carrying one owner's namespace marker.",
5
5
  "license": "MIT",
6
6
  "author": "Patrick Koss",
@@ -38,7 +38,7 @@
38
38
  "build": "tsc -p tsconfig.json",
39
39
  "prepare": "pnpm run build",
40
40
  "test": "tsc -p tsconfig.test.json && vitest run --config ../../vitest.config.ts && node ../../scripts/test-packed-exports.mjs",
41
- "lint": "eslint src --max-warnings=0",
41
+ "lint": "eslint . --max-warnings=0",
42
42
  "format:check": "prettier --check src package.json tsconfig.json tsconfig.test.json"
43
43
  },
44
44
  "devDependencies": {
@@ -46,10 +46,10 @@
46
46
  "@baukit/notifications-core": "workspace:*",
47
47
  "expo-notifications": "57.0.21",
48
48
  "typescript": "6.0.3",
49
- "vitest": "5.0.3"
49
+ "vitest": "5.0.5"
50
50
  },
51
51
  "peerDependencies": {
52
- "@baukit/notifications-core": "^0.18.3",
52
+ "@baukit/notifications-core": "^0.19.1",
53
53
  "expo-notifications": "^57.0.21"
54
54
  }
55
55
  }
package/src/index.test.ts CHANGED
@@ -92,11 +92,11 @@ class ExpoNotificationsMock {
92
92
  const identifier = request.identifier ?? 'generated';
93
93
  this.faults.beforeSchedule(identifier);
94
94
  this.scheduled.push(request);
95
- this.requests.set(identifier, {
96
- identifier,
97
- content: request.content,
98
- trigger: request.trigger,
99
- } as NotificationRequest);
95
+ const pending: Pick<NotificationRequest, 'identifier'> & {
96
+ readonly content: NotificationRequestInput['content'];
97
+ readonly trigger: NotificationRequestInput['trigger'];
98
+ } = { identifier, content: request.content, trigger: request.trigger };
99
+ this.requests.set(identifier, pending as NotificationRequest);
100
100
  return identifier;
101
101
  }),
102
102
  };
@@ -223,10 +223,8 @@ describe('Expo owned notification scheduler', () => {
223
223
  ['authorized', IOS_STATUS.AUTHORIZED],
224
224
  ])('treats iOS %s authorization as granted', async (_label, iosStatus) => {
225
225
  const { mock, scheduler } = setup();
226
- mock.permissionOverride = {
227
- ...permissionStatus('undetermined'),
228
- ios: { status: iosStatus },
229
- } as NotificationPermissionsStatus;
226
+ const override = { ...permissionStatus('undetermined'), ios: { status: iosStatus } };
227
+ mock.permissionOverride = override as NotificationPermissionsStatus;
230
228
  expect(
231
229
  await scheduler.replaceOwned(OWNER, [desired('a', { content: { title: 'x' } })]),
232
230
  ).toMatchObject({ status: 'complete', scheduled: ['a'] });