Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
619b54e
feat(testing-library): add @lynx-js/lynx-dom
upupming Mar 5, 2025
0e6fd55
feat(testing-library): add @lynx-js/lynx-dom-jest-matchers
upupming Mar 5, 2025
afe4b39
feat(testing-library): add @lynx-js/lynx-dom-testing-library
upupming Mar 5, 2025
e84b833
feat(testing-library): add @lynx-js/react-lynx-testing-library
upupming Mar 5, 2025
ea01a2e
feat: avoid using waitSchedule
upupming Mar 5, 2025
3108dbe
feat(testing-library): support customize runtimePkgName
upupming Mar 6, 2025
928de53
chore(testing-library): change example package name
upupming Mar 6, 2025
87e1124
style: remove debugger and rename variable name
upupming Mar 7, 2025
fa95e63
Merge branch 'main' into feat/testing-library-lynx-dom
upupming Mar 7, 2025
fec5024
Merge remote-tracking branch 'gh/main' into feat/testing-library-reac…
upupming Mar 7, 2025
85484b8
fix: destroyWorklet import path
upupming Mar 7, 2025
d76e3ca
feat: refine type defs
upupming Mar 7, 2025
964b5de
Merge branch 'feat/testing-library-lynx-dom' into feat/testing-librar…
upupming Mar 7, 2025
39e143c
feat: mts main thread ref
upupming Mar 10, 2025
5413606
Merge remote-tracking branch 'gh/main' into feat/testing-library-reac…
upupming Mar 11, 2025
3d7b0bf
feat(testing-library): return value for runOnBackground()
upupming Mar 11, 2025
8306464
feat: remove nativeMethodQueue
upupming Mar 12, 2025
646d872
feat: use jsdom to implement elementTree
upupming Mar 12, 2025
d76d869
feat: remove jest-matchers
upupming Mar 12, 2025
ed0a2ab
Merge remote-tracking branch 'gh/main' into feat/testing-library-reac…
upupming Mar 12, 2025
8a1f4b8
Merge remote-tracking branch 'gh/main' into feat/testing-library-reac…
upupming Mar 12, 2025
dc3e0a9
fix: patch paths
upupming Mar 12, 2025
6f91387
chore: fix deps
upupming Mar 12, 2025
88dac99
feat: fixing test cases
upupming Mar 13, 2025
980ccde
Merge remote-tracking branch 'gh/main' into feat/testing-library-reac…
upupming Mar 13, 2025
f1b3a11
feat: use esm for vitest config
upupming Mar 13, 2025
1c445ae
chore: add ci
upupming Mar 13, 2025
213012b
chore: add ci log
upupming Mar 13, 2025
97b3fc0
feat: children[0] -> firstChild
upupming Mar 14, 2025
00e9308
feat: remove use of @lynx-js/lynx-dom-testing-library
upupming Mar 14, 2025
018558a
feat: remove @lynx-js/lynx-dom-testing-library
upupming Mar 14, 2025
4dc0b4e
feat: rename lynxDOM to lynxRuntime
upupming Mar 14, 2025
fd7bac2
Merge remote-tracking branch 'gh/main' into feat/testing-library-reac…
upupming Mar 14, 2025
afc7a34
fix: types issue
upupming Mar 14, 2025
be73f7a
chore: clean files
upupming Mar 14, 2025
b6d7a13
Merge remote-tracking branch 'gh/main' into feat/testing-library-reac…
upupming Mar 17, 2025
83ae028
feat: add missing turbo.json files
upupming Mar 17, 2025
6f2da8d
feat: handle renamed files
upupming Mar 17, 2025
7a4e87c
feat: rename lynxRuntime to lynxEnv
upupming Mar 17, 2025
3a294ec
feat: use __MAIN_THREAD__ and LynxElement
upupming Mar 17, 2025
3e96970
feat: update changeset
upupming Mar 17, 2025
3a9025b
feat: add usage of element.props
upupming Mar 31, 2025
edb43dc
feat(testing-library): add api docs
upupming Apr 3, 2025
6d5a19a
Merge remote-tracking branch 'gh/main' into feat/testing-library-reac…
upupming Apr 3, 2025
cd350b3
fix: patchesToCommit clear issue
upupming Apr 3, 2025
80245a1
Merge remote-tracking branch 'gh/main' into feat/testing-library-reac…
upupming Apr 3, 2025
3ee41ca
fix: workletRefInitValuePatch should before updateWorkletRef
upupming Apr 3, 2025
10271e6
fix: dep & cspell
upupming Apr 3, 2025
03f1592
fix: dep & cspell
upupming Apr 3, 2025
d8705ad
chore: update test.yml
upupming Apr 3, 2025
f1b0561
Merge remote-tracking branch 'gh/main' into feat/testing-library-reac…
upupming Apr 3, 2025
f8993bb
docs(testing-library): update docs
upupming Apr 7, 2025
50357f2
Merge remote-tracking branch 'gh/main' into feat/testing-library-reac…
upupming Apr 7, 2025
6c6d63f
feat: clearPage
upupming Apr 9, 2025
1af787f
Merge remote-tracking branch 'gh/main' into feat/testing-library-reac…
upupming Apr 9, 2025
5a974d9
feat: move testing library to @lynx-js/react package
upupming Apr 11, 2025
7fc7720
feat: remove __UpdateListActions
upupming Apr 11, 2025
7bfd660
Merge remote-tracking branch 'gh/main' into feat/testing-library-reac…
upupming Apr 11, 2025
a90ad7c
chore: update changeset
upupming Apr 11, 2025
636428b
fix: test-publish need version
upupming Apr 11, 2025
12c637c
feat: use `enterListItemAtIndex` and `leaveListItem`
upupming Apr 15, 2025
cc814fb
Merge remote-tracking branch 'gh/main' into feat/testing-library-reac…
upupming Apr 15, 2025
97557eb
feat: update api
upupming Apr 15, 2025
5ded740
feat: update README.md
upupming Apr 15, 2025
23a7d6f
feat: clean old files
upupming Apr 15, 2025
63e0972
feat: make @testing-library/jest-dom and @lynx-js/lynx-environment as…
upupming Apr 15, 2025
6b423a5
feat: rename to @lynx-js/test-environment
upupming Apr 15, 2025
d56c201
Merge remote-tracking branch 'gh/main' into feat/testing-library-reac…
upupming Apr 15, 2025
5d22dfd
feat: remove sourceMap: true
upupming Apr 15, 2025
d2ca9c2
Merge remote-tracking branch 'gh/main' into feat/testing-library-reac…
upupming Apr 16, 2025
fd6ac16
fix: dep
upupming Apr 17, 2025
c24e5bc
Merge remote-tracking branch 'gh/main' into feat/testing-library-reac…
upupming Apr 17, 2025
4ee0164
feat: remove not needed deps (jsdom) from @lynx-js/test-environment
upupming Apr 17, 2025
85a84a0
feat: jsdom install prompt
upupming Apr 17, 2025
292e52a
feat: prebundle packages
upupming Apr 17, 2025
c58b5c5
chore: crop deps
upupming Apr 18, 2025
7f73753
feat: add rltl to create-rspeedy
upupming Apr 18, 2025
008db43
feat: unref and events cases
upupming Apr 18, 2025
7aaa756
feat: more ref cases
upupming Apr 18, 2025
67a3f94
Merge branch 'main' into feat/testing-library-react-lynx-testing-library
upupming Apr 21, 2025
1facb46
fix: unmount ui updates
upupming Apr 22, 2025
9dd619d
fix: remove not needed null set
upupming Apr 22, 2025
f3a2636
Merge remote-tracking branch 'gh/main' into feat/testing-library-reac…
upupming Apr 22, 2025
aaeff50
fix: clear code
upupming Apr 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/dull-heads-fall.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@lynx-js/react": patch
"@lynx-js/test-environment": patch
"create-rspeedy": patch
---

Add testing library for ReactLynx
26 changes: 26 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ jobs:
cd create-rspeedy-regression
pnpm install --registry=http://localhost:4873
pnpm run build
npx --registry http://localhost:4873 create-rspeedy-canary@latest --template react-vitest-rltl --dir create-rspeedy-regression-vitest-rltl
cd create-rspeedy-regression-vitest-rltl
pnpm install --registry=http://localhost:4873
pnpm run build
pnpm run test
test-tools:
needs: build
uses: ./.github/workflows/workflow-test.yml
Expand All @@ -170,6 +175,26 @@ jobs:
--no-cache
--logHeapUsage
--silent
test-testing-library:
needs: build
uses: ./.github/workflows/workflow-test.yml
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
runs-on: lynx-ubuntu-24.04-medium
run: >
pnpm run test
--project 'react/testing-library'
--project 'testing-library/*'
--test-timeout=50000
--reporter=github-actions
--reporter=dot
--reporter=junit
--outputFile=test-report.junit.xml
--coverage
--no-cache
--logHeapUsage
--silent
test-type:
needs: build
uses: ./.github/workflows/workflow-test.yml
Expand Down Expand Up @@ -247,6 +272,7 @@ jobs:
- test-rust
- test-rspeedy
- test-tools
- test-testing-library
- test-type
- website
- zizmor
Expand Down
3 changes: 3 additions & 0 deletions biome.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
"packages/web-platform/**",

"packages/third-party/**",

"packages/testing-library/**",
"packages/react/testing-library/**",
],
"rules": {
// We are migrating from ESLint to Biome
Expand Down
16 changes: 16 additions & 0 deletions cspell.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,22 @@
"parseable", // https://pnpm.io/cli/list
"debugids", // https://getsentry.github.io/debugids/
"zizmor", // https://github.com/woodruffw/zizmor
"wvid",
"bindscroll",
"deinit",
"layoutchange", // the "layoutchange" event of Lynx
"longtap",
"bgload",
"bgerror",
"mouseclick",
"mousedblclick",
"mouselongpress",
"mouselongpress",
"contentsizechanged",
"scrolltoupperedge",
"scrolltoloweredge",
"scrolltonormalstate",
"rltl", // ReactLynx Testing Library
// lighthouse CI
"lhci",
"lh",
Expand Down
5 changes: 5 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ export default tseslint.config(
// TODO: enable eslint for web-platform
// web-platform
'packages/web-platform/**',

// TODO: enable eslint for testing-library
// testing-library
'packages/testing-library/**',
'packages/react/testing-library/**',
],
},
js.configs.recommended,
Expand Down
16 changes: 16 additions & 0 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,18 @@
"lazy": "./runtime/lazy/legacy-react-runtime.js",
"default": "./runtime/lib/legacy-react-runtime/index.js"
},
"./testing-library": {
"types": "./testing-library/types/index.d.ts",
"default": "./testing-library/dist/index.js"
},
"./testing-library/pure": {
"types": "./testing-library/types/pure.d.ts",
"default": "./testing-library/dist/pure.js"
},
"./testing-library/vitest-config": {
"types": "./testing-library/types/vitest-config.d.ts",
"default": "./testing-library/dist/vitest.config.js"
},
"./package.json": "./package.json"
},
"types": "./types/react.d.ts",
Expand Down Expand Up @@ -139,6 +151,7 @@
"types",
"docs",
"worklet-runtime",
"testing-library",
"CHANGELOG.md",
"internal.js",
"README.md",
Expand All @@ -151,8 +164,11 @@
"preact": "npm:@hongzhiyuan/preact@10.24.0-319c684e"
},
"devDependencies": {
"@lynx-js/test-environment": "workspace:*",
"@lynx-js/types": "^3.2.1",
"@microsoft/api-extractor": "catalog:",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.6.3",
"@types/react": "^18.3.20"
},
"peerDependencies": {
Expand Down
3 changes: 2 additions & 1 deletion packages/react/runtime/__test__/lifecycle.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,11 @@ describe('useEffect', () => {
expect(callback).toHaveBeenCalledTimes(0);
expect(cleanUp).toHaveBeenCalledTimes(0);

expect(callback).toHaveBeenCalledTimes(0);
expect(mtCallbacks.mock.calls.length).toBe(1);
mtCallbacks.mock.calls[0][2]();
lynx.getNativeApp().callLepusMethod.mockClear();
expect(callback).toHaveBeenCalledTimes(0);
expect(callback).toHaveBeenCalledTimes(1);
expect(cleanUp).toHaveBeenCalledTimes(0);

await waitSchedule();
Expand Down
Loading
Loading