Skip to content

Commit 5ee107f

Browse files
committed
fix: move modification of queryString to try block
1 parent 3606808 commit 5ee107f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

__tests__/vite/client-hmr.spec.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,19 @@ describe('Vite - client-hmr', () => {
7878
});
7979
});
8080

81+
it('should not throw backendConnector options is not available', () => {
82+
i18nMock.services = {
83+
...i18nMock.services,
84+
backendConnector: { backend: {} },
85+
};
86+
i18nMock.language = 'en';
87+
i18nMock.options = { ns: ['name-space'] };
88+
89+
applyClientHMR(i18nMock);
90+
91+
expect(() => whenHotTriggeredWith(['en/name-space'])).not.toThrow();
92+
});
93+
8194
it('should trigger reload when translation file changed', async () => {
8295
i18nMock.options = { backend: {}, ns: ['name-space'] };
8396
i18nMock.language = 'en';

0 commit comments

Comments
 (0)