Skip to content

Commit d9063f6

Browse files
committed
Fix tests
1 parent 4789821 commit d9063f6

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/utils/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ export function getColumnWidthForMeasurement<R, SR>(
2727
}
2828

2929
const widthWithUnit = typeof width === 'number' ? `${width}px` : width;
30+
31+
// don't break in Node.js (SSR) and jsdom
32+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
33+
if (CSS == null) {
34+
return widthWithUnit;
35+
}
36+
3037
const hasMaxWidth = maxWidth != null;
3138
const clampedWidth = hasMaxWidth
3239
? `clamp(${minWidth}px, ${widthWithUnit}, ${maxWidth}px)`

0 commit comments

Comments
 (0)