Make PASTE_WORKAROUND the default. (#12008)

This commit is contained in:
Tommaso Sciortino
2025-10-24 19:55:13 -07:00
committed by GitHub
parent ce26b58f09
commit ef70e63230
4 changed files with 11 additions and 36 deletions
+4 -18
View File
@@ -66,13 +66,6 @@ describe('useKeypress', () => {
});
});
const setNodeVersion = (version: string) => {
Object.defineProperty(process.versions, 'node', {
value: version,
configurable: true,
});
};
it('should not listen if isActive is false', () => {
renderHook(() => useKeypress(onKeypress, { isActive: false }), {
wrapper,
@@ -124,19 +117,12 @@ describe('useKeypress', () => {
describe.each([
{
description: 'Modern Node (>= v20)',
setup: () => setNodeVersion('20.0.0'),
description: 'PASTE_WORKAROUND true',
setup: () => vi.stubEnv('PASTE_WORKAROUND', 'true'),
},
{
description: 'Legacy Node (< v20)',
setup: () => setNodeVersion('18.0.0'),
},
{
description: 'Workaround Env Var',
setup: () => {
setNodeVersion('20.0.0');
vi.stubEnv('PASTE_WORKAROUND', 'true');
},
description: 'PASTE_WORKAROUND false',
setup: () => vi.stubEnv('PASTE_WORKAROUND', 'false'),
},
])('in $description', ({ setup }) => {
beforeEach(() => {