Closed Andarist closed 1 year ago
I think this change broke the test target:
Details:
/Users/bvaughn/Documents/git/oss/react-virtualized-auto-sizer/src/vendor/detectElementResize.js:285
export { createDetectElementResize };
^^^^^^
SyntaxError: Unexpected token 'export'
1 | import { Component, createElement, CSSProperties, ReactElement } from "react";
2 |
> 3 | import {
| ^
4 | createDetectElementResize,
5 | DetectElementResize,
6 | } from "./vendor/detectElementResize";
at Runtime.createScriptFromCode (node_modules/.pnpm/jest-runtime@29.5.0/node_modules/jest-runtime/build/index.js:1495:14)
at Object.<anonymous> (src/AutoSizer.ts:3:1)
at Object.<anonymous> (src/AutoSizer.test.tsx:8:1)
My bad for not having tests run on PRs for this project 💩
I will look into this soon
This fixes it:
diff --git a/jest.config.js b/jest.config.js
index bd9f347..5352e83 100644
--- a/jest.config.js
+++ b/jest.config.js
@@ -1,5 +1,15 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
+ globals: {
+ "ts-jest": {
+ tsconfig: {
+ allowJs: true,
+ },
+ },
+ },
preset: "ts-jest",
testMatch: ["**/*.test.{ts,tsx}"],
+ transform: {
+ "^.+\\.[tj]sx?$": "ts-jest",
+ },
};
Published in 1.0.19
Thank you! 🙇🏼