Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit a587120

Browse files
Add support for JSX in stuff we import in Cypress test code (#8738)
* Add support for JSX in stuff we import in Cypress test code Spawning from: - #8354 (comment) - #8354 (comment) * Add problem import * Inherit from existing type definitions See #8738 (comment) * Specify `commonjs` Signed-off-by: Šimon Brandner <[email protected]> * Remove `mxSettingsStore` as it's no longer needed Signed-off-by: Šimon Brandner <[email protected]> Co-authored-by: Šimon Brandner <[email protected]>
1 parent 89ae540 commit a587120

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

cypress/global.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17+
import "../src/@types/global";
18+
import "../src/@types/svg";
19+
import "../src/@types/raw-loader";
1720
import "matrix-js-sdk/src/@types/global";
1821
import type {
1922
MatrixClient,

cypress/tsconfig.json

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
{
22
"compilerOptions": {
33
"target": "es2016",
4-
"lib": ["es2020", "dom"],
4+
"jsx": "react",
5+
"lib": [
6+
"es2020",
7+
"dom",
8+
"dom.iterable"
9+
],
510
"types": ["cypress", "@percy/cypress"],
6-
"moduleResolution": "node"
11+
"resolveJsonModule": true,
12+
"esModuleInterop": true,
13+
"moduleResolution": "node",
14+
"module": "commonjs"
715
},
8-
"include": ["**/*.ts"]
16+
"include": [
17+
"**/*.ts"
18+
]
919
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"lint": "yarn lint:types && yarn lint:js && yarn lint:style",
4747
"lint:js": "eslint --max-warnings 0 src test cypress",
4848
"lint:js-fix": "eslint --fix src test cypress",
49-
"lint:types": "tsc --noEmit --jsx react && tsc --noEmit -p cypress",
49+
"lint:types": "tsc --noEmit --jsx react && tsc --noEmit --jsx react -p cypress",
5050
"lint:style": "stylelint \"res/css/**/*.scss\"",
5151
"test": "jest",
5252
"test:cypress": "cypress run",

0 commit comments

Comments
 (0)