Skip to content
This repository has been archived by the owner on Oct 9, 2024. It is now read-only.

Commit

Permalink
tests: Add UI tests for transformed codes
Browse files Browse the repository at this point in the history
  • Loading branch information
mohebifar committed Mar 2, 2024
1 parent 9f87a1a commit eb563e8
Show file tree
Hide file tree
Showing 37 changed files with 1,502 additions and 217 deletions.
25 changes: 14 additions & 11 deletions packages/compiler/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,20 +78,12 @@ const config: Config = {
// ],

// An array of file extensions your modules use
// moduleFileExtensions: [
// "js",
// "mjs",
// "cjs",
// "jsx",
// "ts",
// "tsx",
// "json",
// "node"
// ],
moduleFileExtensions: ["js", "jsx", "ts", "tsx"],

// A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
moduleNameMapper: {
"^~/(.*)$": "<rootDir>/src/$1",
"@react-unforget/runtim": "<rootDir>/../runtime/dist/index.cjs"
},

// An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
Expand Down Expand Up @@ -175,7 +167,18 @@ const config: Config = {
// testRunner: "jest-circus/runner",

// A map from regular expressions to paths to transformers
// transform: undefined,
transform: {
"fixture_\\d+\\.jsx?$": [
"babel-jest",
{
presets: [
["@babel/preset-env", { targets: { node: "current" } }],
"@babel/preset-react",
],
plugins: ["@react-unforget/babel-plugin"],
},
],
},

// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
// transformIgnorePatterns: [
Expand Down
9 changes: 8 additions & 1 deletion packages/compiler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,26 @@
},
"devDependencies": {
"@babel/plugin-syntax-jsx": "^7.23.3",
"@babel/preset-env": "^7.24.0",
"@babel/preset-react": "^7.23.3",
"@babel/standalone": "^7.24.0",
"@react-unforget/eslint-config": "*",
"@react-unforget/jest-config": "*",
"@react-unforget/typescript-config": "*",
"@testing-library/react": "^14.2.1",
"@testing-library/user-event": "^14.5.2",
"@types/babel__standalone": "^7.1.7",
"@types/babel__traverse": "^7.20.5",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"tsup": "^8.0.2"
},
"dependencies": {
"@babel/helper-validator-identifier": "^7.22.20",
"@babel/parser": "^7.24.0",
"@babel/traverse": "^7.24.0",
"@babel/types": "^7.24.0"
"@babel/types": "^7.24.0",
"@react-unforget/babel-plugin": "^0.1.0-dev.7"
},
"publishConfig": {
"access": "public"
Expand Down
56 changes: 0 additions & 56 deletions packages/compiler/src/classes/tests/Component-basic.test.ts

This file was deleted.

3 changes: 0 additions & 3 deletions packages/compiler/src/fixtures/fixture_1.js

This file was deleted.

Loading

0 comments on commit eb563e8

Please sign in to comment.