From b99628d5eeb7cc5bf057a0bcdd48508c1550e581 Mon Sep 17 00:00:00 2001 From: Dermot Duffy Date: Sat, 27 Jan 2024 17:39:47 -0800 Subject: [PATCH 1/3] Fix minor seeking issue in unreleased code. --- src/view/view.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/view/view.ts b/src/view/view.ts index a402b3ad..6d395a9b 100644 --- a/src/view/view.ts +++ b/src/view/view.ts @@ -178,7 +178,7 @@ export class View { * @returns This view. */ public mergeInContext(context?: ViewContext): View { - this.context = merge(this.context ?? {}, this.context, context); + this.context = merge({}, this.context, context); return this; } From 1f70866ce65b952e14e0ab3db4c31e31f8701028 Mon Sep 17 00:00:00 2001 From: Dermot Duffy Date: Sat, 27 Jan 2024 17:43:00 -0800 Subject: [PATCH 2/3] Add test. --- tests/view/view.test.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/view/view.test.ts b/tests/view/view.test.ts index 0703f226..bea28a03 100644 --- a/tests/view/view.test.ts +++ b/tests/view/view.test.ts @@ -113,6 +113,12 @@ describe('View Basics', () => { view.mergeInContext({ timeline: timelineContext }); expect(view.context?.live).toEqual(liveContext); expect(view.context?.timeline).toEqual(timelineContext); + + // Verify that merging context creates a new context object, as some + // downstream users may check for context equality. + const oldContext = view.context; + view.mergeInContext({ live: liveContext }); + expect(view.context).not.toBe(oldContext); }); it('should remove context', () => { From 94ade5beb573211c702a33dcb33fed4633e4fc93 Mon Sep 17 00:00:00 2001 From: Dermot Duffy Date: Sat, 27 Jan 2024 17:57:41 -0800 Subject: [PATCH 3/3] Adjust branch coverage. --- vite.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vite.config.ts b/vite.config.ts index 8647cf09..c788fc81 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -11,7 +11,7 @@ export default defineConfig({ // back-sliding. thresholdAutoUpdate: true, statements: 71.95, - branches: 60.8, + branches: 60.78, functions: 73.04, lines: 71.84, },