diff --git a/.darklua-dev.json b/.darklua-dev.json new file mode 100644 index 0000000..a4e9611 --- /dev/null +++ b/.darklua-dev.json @@ -0,0 +1,29 @@ +{ + "rules": [ + { + "rule": "convert_require", + "current": { + "name": "path", + "sources": { + "@pkg": "node_modules/.luau-aliases" + } + }, + "target": { + "name": "roblox", + "indexing_style": "wait_for_child", + "rojo_sourcemap": "sourcemap.json" + } + }, + { + "rule": "inject_global_value", + "identifier": "__DEV__", + "value": true + }, + "compute_expression", + "remove_unused_if_branch", + "remove_unused_while", + "filter_after_early_return", + "remove_nil_declaration", + "remove_empty_do" + ] +} diff --git a/.darklua-tests.json b/.darklua-tests.json new file mode 100644 index 0000000..313b915 --- /dev/null +++ b/.darklua-tests.json @@ -0,0 +1,42 @@ +{ + "rules": [ + "remove_comments", + "remove_spaces", + { + "rule": "convert_require", + "current": { + "name": "path", + "sources": { + "@pkg": "node_modules/.luau-aliases" + } + }, + "target": { + "name": "roblox", + "rojo_sourcemap": "sourcemap.json", + "indexing_style": "wait_for_child" + } + }, + { + "rule": "inject_global_value", + "identifier": "LUA_ENV", + "value": "roblox" + }, + { + "rule": "inject_global_value", + "identifier": "DEV", + "value": false + }, + { + "rule": "inject_global_value", + "identifier": "__DEV__", + "value": false + }, + "compute_expression", + "remove_unused_if_branch", + "filter_after_early_return", + "convert_index_to_field", + "remove_unused_while", + "remove_empty_do", + "remove_method_definition" + ] +} diff --git a/.darklua-wally.json b/.darklua-wally.json new file mode 100644 index 0000000..b8e35a2 --- /dev/null +++ b/.darklua-wally.json @@ -0,0 +1,24 @@ +{ + "rules": [ + { + "rule": "convert_require", + "current": { + "name": "path", + "sources": { + "@pkg": "." + } + }, + "target": { + "name": "roblox", + "indexing_style": "wait_for_child", + "rojo_sourcemap": "./sourcemap.json" + } + }, + "compute_expression", + "remove_unused_if_branch", + "remove_unused_while", + "filter_after_early_return", + "remove_nil_declaration", + "remove_empty_do" + ] +} diff --git a/.darklua.json b/.darklua.json new file mode 100644 index 0000000..1cba09c --- /dev/null +++ b/.darklua.json @@ -0,0 +1,29 @@ +{ + "rules": [ + { + "rule": "convert_require", + "current": { + "name": "path", + "sources": { + "@pkg": "node_modules/.luau-aliases" + } + }, + "target": { + "name": "roblox", + "indexing_style": "wait_for_child", + "rojo_sourcemap": "sourcemap.json" + } + }, + { + "rule": "inject_global_value", + "identifier": "__DEV__", + "value": false + }, + "compute_expression", + "remove_unused_if_branch", + "remove_unused_while", + "filter_after_early_return", + "remove_nil_declaration", + "remove_empty_do" + ] +} diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..d45b9fa --- /dev/null +++ b/.gitattributes @@ -0,0 +1,6 @@ +# * text eol=lf + +*.gif binary +*.ico binary +*.jpg binary +*.png binary diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..088544c --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,5 @@ +Closes #[issue number] + + + +- [ ] add entry to the changelog diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..bb131fb --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,170 @@ +name: Release + +"on": + workflow_dispatch: + inputs: + release_tag: + description: The version to release starting with `v` + required: true + type: string + release_ref: + description: The branch, tag or SHA to checkout (default to latest) + default: "" + type: string + +permissions: + contents: write + +jobs: + publish-package: + name: Publish package + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Enable corepack + run: corepack enable + + - uses: actions/setup-node@v3 + with: + node-version: latest + registry-url: https://registry.npmjs.org + cache: yarn + cache-dependency-path: yarn.lock + + - name: Install packages + run: yarn install --immutable + + - name: Run npmluau + run: yarn run prepare + + - name: Authenticate yarn + run: |- + yarn config set npmAlwaysAuth true + yarn config set npmAuthToken $NPM_AUTH_TOKEN + env: + NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + + - name: Publish to npm + run: yarn npm publish --access public + + publish-wally-package: + needs: publish-package + + name: Publish wally package + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: Roblox/setup-foreman@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Enable corepack + run: corepack enable + + - uses: actions/setup-node@v3 + with: + node-version: "latest" + cache: "yarn" + cache-dependency-path: "yarn.lock" + + - name: Install packages + run: yarn install --immutable + + - name: Run npmluau + run: yarn run prepare + + - name: Build artifacts + run: yarn run build + + - name: Login to wally + run: wally login --project-path build/wally --token ${{ secrets.WALLY_ACCESS_TOKEN }} + + - name: Publish to wally + run: wally publish --project-path build/wally + + create-release: + needs: publish-package + name: Create release + runs-on: ubuntu-latest + outputs: + upload_url: ${{ steps.create_release.outputs.upload_url }} + steps: + - uses: actions/checkout@v4 + + - name: Create tag + run: | + git fetch --tags --no-recurse-submodules + if [ ! $(git tag -l ${{ inputs.release_tag }}) ]; then + git tag ${{ inputs.release_tag }} + git push origin ${{ inputs.release_tag }} + fi + + - name: Create release + id: create_release + uses: softprops/action-gh-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ inputs.release_tag }} + name: ${{ inputs.release_tag }} + draft: false + + build-assets: + needs: create-release + name: Add assets + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - artifact-name: react-testing-library.rbxm + path: build/react-testing-library.rbxm + asset-type: application/octet-stream + + - artifact-name: react-testing-library-dev.rbxm + path: build/debug/react-testing-library.rbxm + asset-type: application/octet-stream + steps: + - uses: actions/checkout@v4 + + - uses: Roblox/setup-foreman@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Enable corepack + run: corepack enable + + - uses: actions/setup-node@v3 + with: + node-version: latest + registry-url: https://registry.npmjs.org + cache: yarn + cache-dependency-path: yarn.lock + + - name: Install packages + run: yarn install --immutable + + - name: Run npmluau + run: yarn run prepare + + - name: Build assets + run: yarn run build + + - name: Upload asset + uses: actions/upload-artifact@v3 + with: + name: ${{ matrix.artifact-name }} + path: ${{ matrix.path }} + + - name: Add asset to Release + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.create-release.outputs.upload_url }} + asset_path: ${{ matrix.path }} + asset_name: ${{ matrix.artifact-name }} + asset_content_type: ${{ matrix.asset-type }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..e5fc585 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,42 @@ +name: Tests + +"on": + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + test: + name: Run tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: Roblox/setup-foreman@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Enable corepack + run: corepack enable + + - uses: actions/setup-node@v3 + with: + node-version: latest + registry-url: https://registry.npmjs.org + cache: yarn + cache-dependency-path: yarn.lock + + - name: Install packages + run: yarn install --immutable + + - name: Run npmluau + run: yarn run prepare + + - name: Run linter + run: yarn run lint + + - name: Verify code style + run: yarn run style-check diff --git a/.gitignore b/.gitignore index 0f2ecf7..293881c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,18 @@ -Packages/* -!Packages/.robloxrc - -rotriever.lock -roblox.toml -*.rbxmx -*.rbxm - -.vscode/launch.json -.vscode/settings.json -.vscode/tasks.json -.idea +/site + +/*.rbxl +/*.rbxlx +/*.rbxl.lock +/*.rbxlx.lock +/*.rbxm +/*.rbxmx + +/temp +/node_modules +/build + +.yarn + +/globalTypes.d.lua + +**/sourcemap.json diff --git a/.luau-analyze.json b/.luau-analyze.json new file mode 100644 index 0000000..89f7b87 --- /dev/null +++ b/.luau-analyze.json @@ -0,0 +1,6 @@ +{ + "luau-lsp.require.mode": "relativeToFile", + "luau-lsp.require.directoryAliases": { + "@pkg": "node_modules/.luau-aliases" + } +} diff --git a/.luaurc b/.luaurc new file mode 100644 index 0000000..9a3da68 --- /dev/null +++ b/.luaurc @@ -0,0 +1,10 @@ +{ + "languageMode": "strict", + "lintErrors": true, + "lint": { + "*": true + }, + "aliases": { + "pkg": "./node_modules/.luau-aliases" + } +} diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..4281967 --- /dev/null +++ b/.npmignore @@ -0,0 +1,33 @@ +/.* +/scripts +/docs +/site + +/build +/temp + +/*.json +/*.json5 +/*.yml +/*.toml +/*.md +/*.txt +/*.tgz + +*.d.lua +*.d.luau +*.spec.lua +*.spec.luau +*.test.lua +*.test.luau +**/tests +**/__tests__ +jest.config.lua +jest.config.luau + +**/*.rbxl +**/*.rbxlx +**/*.rbxl.lock +**/*.rbxlx.lock +**/*.rbxm +**/*.rbxmx diff --git a/.styluaignore b/.styluaignore new file mode 100644 index 0000000..853ac00 --- /dev/null +++ b/.styluaignore @@ -0,0 +1,6 @@ +/node_modules +/temp +/build + +**/*.d.lua +**/*.d.luau diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..70cba43 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,8 @@ +{ + "recommendations": [ + "johnnymorganz.luau-lsp", + "johnnymorganz.stylua", + "github.vscode-github-actions", + "Kampfkarren.selene-vscode" + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..c7fea06 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,9 @@ +{ + "luau-lsp.require.directoryAliases": { + "@pkg": "node_modules/.luau-aliases" + }, + "luau-lsp.sourcemap.autogenerate": false, + "luau-lsp.require.mode": "relativeToFile", + "luau-lsp.completion.imports.requireStyle": "alwaysRelative", + "luau-lsp.platform.type": "roblox" +} diff --git a/.yarnrc.yml b/.yarnrc.yml new file mode 100644 index 0000000..3186f3f --- /dev/null +++ b/.yarnrc.yml @@ -0,0 +1 @@ +nodeLinker: node-modules diff --git a/Packages/.robloxrc b/Packages/.robloxrc deleted file mode 100644 index fb31f2e..0000000 --- a/Packages/.robloxrc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": { - "mode": "nocheck" - }, - "lint": { - "*": "disabled" - } -} \ No newline at end of file diff --git a/bin/ci.sh b/bin/ci.sh deleted file mode 100755 index c2098e2..0000000 --- a/bin/ci.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -set -x - -echo "Remove .robloxrc from dev dependencies" -find Packages/Dev -name "*.robloxrc" | xargs rm -f -find Packages/_Index -name "*.robloxrc" | xargs rm -f - -echo "Run static analysis" -selene src -robloxdev-cli analyze analyze.project.json -stylua -c src - -echo "Run tests" -robloxdev-cli run --load.place tests.project.json --run bin/spec.lua \ - --lua.globals=__DEV__=true \ - --fastFlags.allOnLuau --fastFlags.overrides EnableLoadModule=true \ - --fs.read=$PWD --load.asRobloxScript --headlessRenderer 1 --virtualInput 1 - -echo "Run tests with mock scheduler" -robloxdev-cli run --load.place tests.project.json --run bin/spec.lua \ - --lua.globals=__DEV__=true --lua.globals=__ROACT_17_MOCK_SCHEDULER__=true \ - --fastFlags.allOnLuau --fastFlags.overrides EnableLoadModule=true \ - --fs.read=$PWD --load.asRobloxScript --headlessRenderer 1 --virtualInput 1 diff --git a/bin/spec.lua b/bin/spec.lua deleted file mode 100644 index 1f494f9..0000000 --- a/bin/spec.lua +++ /dev/null @@ -1,30 +0,0 @@ -local Root = game:GetService("ReplicatedStorage") -local Packages = Root.Packages - -local runCLI = require(Packages.Dev.Jest).runCLI - -local processServiceExists, ProcessService = pcall(function() - return game:GetService("ProcessService") -end) - -local status, result = runCLI(Root, { - verbose = _G.verbose == "true", - ci = _G.CI == "true", - updateSnapshot = _G.UPDATESNAPSHOT == "true", -}, { Packages.ReactTestingLibrary }):awaitStatus() - -if status == "Rejected" then - print(result) -end - -if status == "Resolved" and result.results.numFailedTestSuites == 0 and result.results.numFailedTests == 0 then - if processServiceExists then - ProcessService:ExitAsync(0) - end -end - -if processServiceExists then - ProcessService:ExitAsync(1) -end - -return nil diff --git a/foreman.toml b/foreman.toml index c1e8b28..0eb4f18 100644 --- a/foreman.toml +++ b/foreman.toml @@ -1,6 +1,8 @@ [tools] -rojo = { source = "Roblox/rojo-rbx-rojo", version = "7.2.1" } -rotrieve = { source = "roblox/rotriever", version = "0.5.13-alpha.2" } -selene = { source = "Roblox/Kampfkarren-selene", version = "=0.26.1" } -stylua = { source = "Roblox/JohnnyMorganz-StyLua", version = "=0.14.3" } -rbx-aged-cli = { source = "Roblox/rbx-aged-tool", version = "=5.7.9" } +darklua = { github = "seaofvoices/darklua", version = "=0.13.1"} +luau-lsp = { github = "JohnnyMorganz/luau-lsp", version = "=1.32.4"} +rojo = { github = "rojo-rbx/rojo", version = "=7.4.4"} +run-in-roblox = { github = "rojo-rbx/run-in-roblox", version = "=0.3.0"} +selene = { github = "Kampfkarren/selene", version = "=0.27.1"} +stylua = { github = "JohnnyMorganz/StyLua", version = "=0.20.0"} +wally = { github = "UpliftGames/wally", version = "=0.3.2" } diff --git a/model.project.json b/model.project.json new file mode 100644 index 0000000..9044c02 --- /dev/null +++ b/model.project.json @@ -0,0 +1,9 @@ +{ + "name": "ReactTestingLibrary", + "tree": { + "$path": "src", + "node_modules": { + "$path": "node_modules" + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..e2852c8 --- /dev/null +++ b/package.json @@ -0,0 +1,48 @@ +{ + "name": "@jsdotlua/react-testing-library", + "version": "12.2.1-rc.1", + "repository": { + "type": "git", + "url": "git+https://github.com/jsdotlua/react-testing-library-lua.git" + }, + "contributors": [ + { + "name": "Ignacio Falk", + "email": "flakolefluk@gmail.com" + }, + { + "name": "Allan Jeremy", + "email": "dev@allanjeremy.com" + } + ], + "license": "MIT", + "main": "src/init.lua", + "scripts": { + "build": "sh ./scripts/build.sh", + "clean": "rm -rf node_modules build temp", + "format": "stylua .", + "lint": "sh ./scripts/analyze.sh && selene src", + "lint:luau": "sh ./scripts/analyze.sh", + "lint:selene": "selene src", + "prepare": "npmluau", + "style-check": "stylua --check src", + "test:roblox": "sh ./scripts/roblox-test.sh", + "verify-pack": "yarn pack --dry-run" + }, + "dependencies": { + "@jsdotlua/dom-testing-library": "^8.14.2-rc.1", + "@jsdotlua/jest-globals": "^3.6.1-rc.2", + "@jsdotlua/luau-polyfill": "^1.2.6", + "@jsdotlua/promise": "^3.5.0", + "@jsdotlua/react": "^17.1.0", + "@jsdotlua/react-roblox": "^17.1.0", + "@jsdotlua/scheduler": "^17.1.0", + "@jsdotlua/shared": "^17.1.0" + }, + "devDependencies": { + "@jsdotlua/jest": "^3.6.1-rc.2", + "luau-regexp": "^0.2.1", + "npmluau": "^0.1.1" + }, + "packageManager": "yarn@4.5.0" +} diff --git a/scripts/analyze.sh b/scripts/analyze.sh new file mode 100755 index 0000000..e43cdfc --- /dev/null +++ b/scripts/analyze.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +set -e + +TYPES_FILE=globalTypes.d.lua + +if [ ! -f "$TYPES_FILE" ]; then + curl https://raw.githubusercontent.com/JohnnyMorganz/luau-lsp/main/scripts/globalTypes.d.lua > $TYPES_FILE +fi + +luau-lsp analyze --base-luaurc=.luaurc --settings=.luau-analyze.json \ + --definitions=$TYPES_FILE \ + --ignore '**/node_modules/**' --ignore 'node_modules/**' \ + src diff --git a/scripts/build-roblox-model.sh b/scripts/build-roblox-model.sh new file mode 100755 index 0000000..6f3b5ad --- /dev/null +++ b/scripts/build-roblox-model.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +set -e + +DARKLUA_CONFIG=$1 +OUTPUT=build/$2 + +rm -rf temp + +mkdir -p temp + +cp -r src/ temp/ +./scripts/remove-tests.sh temp + +rojo sourcemap model.project.json -o sourcemap.json + +darklua process --config $DARKLUA_CONFIG node_modules temp/node_modules + +cp $DARKLUA_CONFIG temp/ +cp sourcemap.json temp/ + +darklua process --config temp/$DARKLUA_CONFIG temp/src temp/src + +./scripts/remove-tests.sh temp + +cp model.project.json temp/ + +mkdir -p build +mkdir -p $(dirname $OUTPUT) + +rojo build temp/model.project.json -o $OUTPUT diff --git a/scripts/build-wally-package.sh b/scripts/build-wally-package.sh new file mode 100755 index 0000000..cee2cd0 --- /dev/null +++ b/scripts/build-wally-package.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +set -e + +rm -rf build/wally + +yarn dlx npmwally convert --output build/wally diff --git a/scripts/build.sh b/scripts/build.sh new file mode 100755 index 0000000..3810a4e --- /dev/null +++ b/scripts/build.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +set -e + +./scripts/build-roblox-model.sh .darklua.json react-testing-library.rbxm +./scripts/build-roblox-model.sh .darklua-dev.json debug/react-testing-library.rbxm + +./scripts/build-wally-package.sh diff --git a/scripts/remove-tests.sh b/scripts/remove-tests.sh new file mode 100755 index 0000000..305c98d --- /dev/null +++ b/scripts/remove-tests.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +set -e + +FOLDER=$1 + +find $FOLDER -name '__tests__' -type d -exec rm -r {} + +find $FOLDER -name '__tests__' -type d -exec rm -r {} + +find $FOLDER -name '__fixtures__' -type d -exec rm -r {} + +find $FOLDER -name '__testUtils__' -type d -exec rm -r {} + +find $FOLDER -name 'TestMatchers' -type d -exec rm -r {} + +find $FOLDER -name '.robloxrc' -type f -exec rm -r {} + +find $FOLDER -name '*.spec.lua' -type f -exec rm -r {} + +find $FOLDER -name 'jest.config.lua' -type f -exec rm -r {} + diff --git a/scripts/roblox-test.server.lua b/scripts/roblox-test.server.lua new file mode 100644 index 0000000..9cffe53 --- /dev/null +++ b/scripts/roblox-test.server.lua @@ -0,0 +1,15 @@ +local ReplicatedStorage = game:GetService("ReplicatedStorage") + +local jest = require("@pkg/@jsdotlua/jest") + +local jestRoots = { + ReplicatedStorage:FindFirstChild("TestTarget"), +} + +local success, result = jest.runCLI(ReplicatedStorage, {}, jestRoots):await() + +if not success then + error(result) +end + +task.wait(0.5) diff --git a/scripts/roblox-test.sh b/scripts/roblox-test.sh new file mode 100755 index 0000000..7f4fce8 --- /dev/null +++ b/scripts/roblox-test.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +set -e + +DARKLUA_CONFIG=".darklua-tests.json" + +if [ ! -d node_modules ]; then + yarn install +fi +if [ ! -d node_modules/.luau-aliases ]; then + yarn prepare +fi + +rm -rf temp + +rojo sourcemap test-place.project.json -o sourcemap.json + +darklua process --config $DARKLUA_CONFIG tests temp/tests +darklua process --config $DARKLUA_CONFIG scripts/roblox-test.server.lua temp/scripts/roblox-test.server.lua +darklua process --config $DARKLUA_CONFIG node_modules temp/node_modules +darklua process --config $DARKLUA_CONFIG src temp/src + +cp test-place.project.json temp/ + +rojo build temp/test-place.project.json -o temp/test-place.rbxl + +run-in-roblox --place temp/test-place.rbxl --script temp/scripts/roblox-test.server.lua + +rm -rf temp diff --git a/selene.toml b/selene.toml index c440167..0723972 100644 --- a/selene.toml +++ b/selene.toml @@ -1,4 +1,4 @@ -std = "roblox" +std = "selene_defs+roblox" [config] empty_if = { comments_count = true } diff --git a/selene_defs.yml b/selene_defs.yml new file mode 100644 index 0000000..95cabdf --- /dev/null +++ b/selene_defs.yml @@ -0,0 +1,7 @@ +base: roblox +name: selene_defs +globals: + # override Roblox require style with string requires + require: + args: + - type: string diff --git a/src/.robloxrc b/src/.robloxrc deleted file mode 100644 index 4231d32..0000000 --- a/src/.robloxrc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": { - "mode": "strict" - }, - "lint": { - "*": "enabled" - } -} diff --git a/src/__tests__/act.spec.lua b/src/__tests__/act.spec.lua index eff54ec..4bb70ec 100644 --- a/src/__tests__/act.spec.lua +++ b/src/__tests__/act.spec.lua @@ -1,13 +1,11 @@ -- ROBLOX upstream: https://github.com/testing-library/react-testing-library/blob/v12.1.5/src/__tests__/act.js -local Packages = script.Parent.Parent.Parent - -local JestGlobals = require(Packages.JestGlobals) +local JestGlobals = require("@pkg/@jsdotlua/jest-globals") local expect = JestGlobals.expect local test = JestGlobals.test local jest = JestGlobals.jest -local React = require(Packages.React) -local ParentModule = require(script.Parent.Parent) +local ParentModule = require("..") +local React = require("@pkg/@jsdotlua/react") local render = ParentModule.render local fireEvent = ParentModule.fireEvent local screen = ParentModule.screen diff --git a/src/__tests__/auto-cleanup-skip.spec.lua b/src/__tests__/auto-cleanup-skip.spec.lua index 03fcb1e..6d12354 100644 --- a/src/__tests__/auto-cleanup-skip.spec.lua +++ b/src/__tests__/auto-cleanup-skip.spec.lua @@ -1,19 +1,17 @@ -- ROBLOX upstream: https://github.com/testing-library/react-testing-library/blob/v12.1.5/src/__tests__/auto-cleanup-skip.js -local Packages = script.Parent.Parent.Parent - -local JestGlobals = require(Packages.JestGlobals) +local JestGlobals = require("@pkg/@jsdotlua/jest-globals") local expect = JestGlobals.expect local test = JestGlobals.test local beforeAll = JestGlobals.beforeAll local afterAll = JestGlobals.afterAll -local document = require(Packages.DomTestingLibrary).document +local document = require("@pkg/@jsdotlua/dom-testing-library").document -local React = require(Packages.React) +local React = require("@pkg/@jsdotlua/react") local render, cleanup beforeAll(function() _G.RTL_SKIP_AUTO_CLEANUP = "true" - local rtl = require(script.Parent.Parent) + local rtl = require("..") render = rtl.render -- ROBLOX deviation START: force cleanup cleanup = rtl.cleanup diff --git a/src/__tests__/auto-cleanup.spec.lua b/src/__tests__/auto-cleanup.spec.lua index c86c9a0..af7dbd6 100644 --- a/src/__tests__/auto-cleanup.spec.lua +++ b/src/__tests__/auto-cleanup.spec.lua @@ -1,14 +1,12 @@ -- ROBLOX upstream: https://github.com/testing-library/react-testing-library/blob/v12.1.5/src/__tests__/auto-cleanup.js -local Packages = script.Parent.Parent.Parent - -local JestGlobals = require(Packages.JestGlobals) +local JestGlobals = require("@pkg/@jsdotlua/jest-globals") local expect = JestGlobals.expect local test = JestGlobals.test -local document = require(Packages.DomTestingLibrary).document +local document = require("@pkg/@jsdotlua/dom-testing-library").document -local React = require(Packages.React) -local render = require(script.Parent.Parent).render +local React = require("@pkg/@jsdotlua/react") +local render = require("..").render -- This just verifies that by importing RTL in an -- environment which supports afterEach (like jest) diff --git a/src/__tests__/cleanup.spec.lua b/src/__tests__/cleanup.spec.lua index f2e66a5..0d2b888 100644 --- a/src/__tests__/cleanup.spec.lua +++ b/src/__tests__/cleanup.spec.lua @@ -1,7 +1,5 @@ -- ROBLOX upstream: https://github.com/testing-library/react-testing-library/blob/v12.1.5/src/__tests__/cleanup.js -local Packages = script.Parent.Parent.Parent - -local JestGlobals = require(Packages.JestGlobals) +local JestGlobals = require("@pkg/@jsdotlua/jest-globals") local expect = JestGlobals.expect local test = JestGlobals.test local describe = JestGlobals.describe @@ -9,16 +7,16 @@ local beforeEach = JestGlobals.beforeEach local afterEach = JestGlobals.afterEach local jest = JestGlobals.jest -local LuauPolyfill = require(Packages.LuauPolyfill) +local LuauPolyfill = require("@pkg/@jsdotlua/luau-polyfill") local console = LuauPolyfill.console -local document = require(Packages.DomTestingLibrary).document +local document = require("@pkg/@jsdotlua/dom-testing-library").document -local getElementByName = require(script.Parent.Parent.jsHelpers.Element).getElementByName +local getElementByName = require("../jsHelpers/Element").getElementByName -local React = require(Packages.React) +local React = require("@pkg/@jsdotlua/react") -local ParentModule = require(script.Parent.Parent) +local ParentModule = require("..") local render = ParentModule.render local cleanup = ParentModule.cleanup diff --git a/src/__tests__/debug.spec.lua b/src/__tests__/debug.spec.lua index 5076b05..1519c4d 100644 --- a/src/__tests__/debug.spec.lua +++ b/src/__tests__/debug.spec.lua @@ -1,7 +1,5 @@ -- ROBLOX upstream: https://github.com/testing-library/react-testing-library/blob/v12.1.5/src/__tests__/debug.js -local Packages = script.Parent.Parent.Parent - -local JestGlobals = require(Packages.JestGlobals) +local JestGlobals = require("@pkg/@jsdotlua/jest-globals") local expect = JestGlobals.expect local test = JestGlobals.test local beforeEach = JestGlobals.beforeEach @@ -9,11 +7,11 @@ local afterEach = JestGlobals.afterEach local afterAll = JestGlobals.afterAll local jest = JestGlobals.jest -local LuauPolyfill = require(Packages.LuauPolyfill) +local LuauPolyfill = require("@pkg/@jsdotlua/luau-polyfill") local console = LuauPolyfill.console -local React = require(Packages.React) -local ParentModule = require(script.Parent.Parent) +local ParentModule = require("..") +local React = require("@pkg/@jsdotlua/react") local render = ParentModule.render local screen = ParentModule.screen diff --git a/src/__tests__/end-to-end.spec.lua b/src/__tests__/end-to-end.spec.lua index 33d8ff0..448c6d1 100644 --- a/src/__tests__/end-to-end.spec.lua +++ b/src/__tests__/end-to-end.spec.lua @@ -1,7 +1,5 @@ -- ROBLOX upstream: https://github.com/testing-library/react-testing-library/blob/v12.1.5/src/__tests__/end-to-end.js -local Packages = script.Parent.Parent.Parent - -local JestGlobals = require(Packages.JestGlobals) +local JestGlobals = require("@pkg/@jsdotlua/jest-globals") local expect = JestGlobals.expect local describe = JestGlobals.describe local test = JestGlobals.test @@ -9,15 +7,15 @@ local beforeEach = JestGlobals.beforeEach local afterEach = JestGlobals.afterEach local jest = JestGlobals.jest -local LuauPolyfill = require(Packages.LuauPolyfill) +local LuauPolyfill = require("@pkg/@jsdotlua/luau-polyfill") local Array = LuauPolyfill.Array local setTimeout = LuauPolyfill.setTimeout -local Promise = require(Packages.Promise) -local RegExp = require(Packages.Dev.LuauRegExp) +local Promise = require("@pkg/@jsdotlua/promise") +local RegExp = require("@pkg/luau-regexp") -local React = require(Packages.React) -local ParentModule = require(script.Parent.Parent) +local ParentModule = require("..") +local React = require("@pkg/@jsdotlua/react") local render = ParentModule.render local waitForElementToBeRemoved = ParentModule.waitForElementToBeRemoved local screen = ParentModule.screen diff --git a/src/__tests__/events.spec.lua b/src/__tests__/events.spec.lua index 6de000f..af183e3 100644 --- a/src/__tests__/events.spec.lua +++ b/src/__tests__/events.spec.lua @@ -1,18 +1,16 @@ -- ROBLOX upstream: https://github.com/testing-library/react-testing-library/blob/v12.1.5/src/__tests__/events.js -local Packages = script.Parent.Parent.Parent - -local JestGlobals = require(Packages.JestGlobals) +local JestGlobals = require("@pkg/@jsdotlua/jest-globals") local expect = JestGlobals.expect local test = JestGlobals.test local describe = JestGlobals.describe local jest = JestGlobals.jest -local LuauPolyfill = require(Packages.LuauPolyfill) +local LuauPolyfill = require("@pkg/@jsdotlua/luau-polyfill") local Array = LuauPolyfill.Array -local React = require(Packages.React) +local React = require("@pkg/@jsdotlua/react") -local ParentModule = require(script.Parent.Parent) +local ParentModule = require("..") local render = ParentModule.render local fireEvent = ParentModule.fireEvent @@ -54,11 +52,12 @@ local unhandledEventTypes = { { fireEventName = "pointerLeave" }, }, elementType = "TextButton", + init = nil, }, } -- ROBLOX deviation END -Array.forEach(eventTypes, function(ref) +for _, ref in eventTypes do local type_, events, elementType, init = ref.type, ref.events, ref.elementType, ref.init describe(("%s Events"):format(type_), function() Array.forEach(events, function(event: { fireEventName: string, instanceEventName: string }) @@ -72,12 +71,12 @@ Array.forEach(eventTypes, function(ref) end) end) end) -end) +end -Array.forEach(eventTypes, function(ref) +for _, ref in eventTypes do local type_, events, elementType, init = ref.type, ref.events, ref.elementType, ref.init describe(("Native %s Events"):format(type_), function() - Array.forEach(events, function(eventName) + for _, eventName in events do local nativeEventName = eventName.fireEventName:lower() -- The doubleClick synthetic event maps to the dblclick native event if nativeEventName == "doubleclick" then nativeEventName = "dblclick" @@ -102,9 +101,9 @@ Array.forEach(eventTypes, function(ref) fireEvent[eventName.fireEventName](ref.current, init) expect(spy).toHaveBeenCalledTimes(1) end) - end) + end end) -end) +end test("onChange works", function() local handleChange = jest.fn() @@ -161,20 +160,20 @@ end) -- ROBLOX deviation START: No upstream equivalent -Array.forEach(unhandledEventTypes, function(ref) +for _, ref in unhandledEventTypes do local type_, events, elementType, init = ref.type, ref.events, ref.elementType, ref.init - describe(("Unhandled %s Events"):format(type_), function() - Array.forEach(events, function(event: { fireEventName: string }) + describe(`Unhandled {type_} Events`, function() + for _, event: { fireEventName: string } in events do local propName = ("on%s%s"):format(event.fireEventName:sub(1, 1):upper(), event.fireEventName:sub(2)) - test(("triggers %s"):format(propName), function() + test(`triggers {propName}`, function() local ref = React.createRef() render(React.createElement(elementType, { ref = ref })) expect(function() fireEvent[event.fireEventName](ref.current, init) end).toThrowError(string.format("Event '%s' not supported", event.fireEventName)) end) - end) + end end) -end) +end -- ROBLOX deviation END return {} diff --git a/src/__tests__/multi-base.spec.lua b/src/__tests__/multi-base.spec.lua index be5dc04..c9ff8cf 100644 --- a/src/__tests__/multi-base.spec.lua +++ b/src/__tests__/multi-base.spec.lua @@ -1,17 +1,15 @@ -- ROBLOX upstream: https://github.com/testing-library/react-testing-library/blob/v12.1.5/src/__tests__/multi-base.js -local Packages = script.Parent.Parent.Parent - -local JestGlobals = require(Packages.JestGlobals) +local JestGlobals = require("@pkg/@jsdotlua/jest-globals") local expect = JestGlobals.expect local test = JestGlobals.test local beforeAll = JestGlobals.beforeAll local afterAll = JestGlobals.afterAll -local document = require(Packages.DomTestingLibrary).document +local document = require("@pkg/@jsdotlua/dom-testing-library").document -local React = require(Packages.React) -local render = require(script.Parent.Parent).render +local React = require("@pkg/@jsdotlua/react") +local render = require("..").render -- these are created once per test suite and reused for each case local treeA, treeB diff --git a/src/__tests__/new-act.spec.lua b/src/__tests__/new-act.spec.lua index 6200c42..2ff9951 100644 --- a/src/__tests__/new-act.spec.lua +++ b/src/__tests__/new-act.spec.lua @@ -1,24 +1,22 @@ -- ROBLOX upstream: https://github.com/testing-library/react-testing-library/blob/v12.1.5/src/__tests__/new-act.js -local Packages = script.Parent.Parent.Parent - -local JestGlobals = require(Packages.JestGlobals) +local JestGlobals = require("@pkg/@jsdotlua/jest-globals") local expect = JestGlobals.expect local test = JestGlobals.test local beforeEach = JestGlobals.beforeEach local afterEach = JestGlobals.afterEach local jest = JestGlobals.jest -local LuauPolyfill = require(Packages.LuauPolyfill) +local LuauPolyfill = require("@pkg/@jsdotlua/luau-polyfill") local Error = LuauPolyfill.Error local console = LuauPolyfill.console type Promise = LuauPolyfill.Promise -local Promise = require(Packages.Promise) +local Promise = require("@pkg/@jsdotlua/promise") local asyncAct, consoleErrorMock -- ROBLOX deviation: Mock is not supported --- local _testUtils = require(script.Parent.Parent.jsHelpers["react-dom"]["test-utils"]) +-- local _testUtils = require("../jsHelpers/react-dom/test-utils") -- jest.mock(testUtils, function() -- return { -- act = function(cb) @@ -29,7 +27,7 @@ local asyncAct, consoleErrorMock beforeEach(function() jest.resetModules() - asyncAct = require(script.Parent.Parent["act-compat"]).asyncAct + asyncAct = require("../act-compat").asyncAct -- ROBLOX deviation START: replace spyOn consoleErrorMock = jest.fn() console.error = consoleErrorMock diff --git a/src/__tests__/render.spec.lua b/src/__tests__/render.spec.lua index 945dc14..4feb5df 100644 --- a/src/__tests__/render.spec.lua +++ b/src/__tests__/render.spec.lua @@ -1,17 +1,15 @@ -- ROBLOX upstream: https://github.com/testing-library/react-testing-library/blob/v12.1.5/src/__tests__/render.js -local Packages = script.Parent.Parent.Parent - -local JestGlobals = require(Packages.JestGlobals) +local JestGlobals = require("@pkg/@jsdotlua/jest-globals") local expect = JestGlobals.expect local test = JestGlobals.test local jest = JestGlobals.jest -local document = require(Packages.DomTestingLibrary).document +local document = require("@pkg/@jsdotlua/dom-testing-library").document local CollectionService = game:GetService("CollectionService") -local React = require(Packages.React) -local ReactRoblox = require(Packages.ReactRoblox) -local ParentModule = require(script.Parent.Parent) +local ParentModule = require("..") +local React = require("@pkg/@jsdotlua/react") +local ReactRoblox = require("@pkg/@jsdotlua/react-roblox") local render = ParentModule.render local screen = ParentModule.screen diff --git a/src/__tests__/rerender.spec.lua b/src/__tests__/rerender.spec.lua index d2064c2..db3292b 100644 --- a/src/__tests__/rerender.spec.lua +++ b/src/__tests__/rerender.spec.lua @@ -1,12 +1,10 @@ -- ROBLOX upstream: https://github.com/testing-library/react-testing-library/blob/v12.1.5/src/__tests__/rerender.js -local Packages = script.Parent.Parent.Parent - -local JestGlobals = require(Packages.JestGlobals) +local JestGlobals = require("@pkg/@jsdotlua/jest-globals") local expect = JestGlobals.expect local test = JestGlobals.test -local React = require(Packages.React) -local render = require(script.Parent.Parent).render +local React = require("@pkg/@jsdotlua/react") +local render = require("..").render test("rerender will re-render the element", function() local function Greeting(props) diff --git a/src/__tests__/stopwatch.spec.lua b/src/__tests__/stopwatch.spec.lua index a3628b1..6b9d7a7 100644 --- a/src/__tests__/stopwatch.spec.lua +++ b/src/__tests__/stopwatch.spec.lua @@ -1,23 +1,21 @@ -- ROBLOX upstream: https://github.com/testing-library/react-testing-library/blob/v12.1.5/src/__tests__/stopwatch.js -local Packages = script.Parent.Parent.Parent - -local JestGlobals = require(Packages.JestGlobals) +local JestGlobals = require("@pkg/@jsdotlua/jest-globals") local expect = JestGlobals.expect local test = JestGlobals.test local jest = JestGlobals.jest -local LuauPolyfill = require(Packages.LuauPolyfill) +local LuauPolyfill = require("@pkg/@jsdotlua/luau-polyfill") local console = LuauPolyfill.console local clearInterval = LuauPolyfill.clearInterval local setInterval = LuauPolyfill.setInterval local setTimeout = LuauPolyfill.setTimeout type Object = LuauPolyfill.Object -local Promise = require(Packages.Promise) +local Promise = require("@pkg/@jsdotlua/promise") -local React = require(Packages.React) +local React = require("@pkg/@jsdotlua/react") -local ParentModule = require(script.Parent.Parent) +local ParentModule = require("..") local render = ParentModule.render local fireEvent = ParentModule.fireEvent local screen = ParentModule.screen diff --git a/src/act-compat.lua b/src/act-compat.lua index 89cf0a2..c9527c8 100644 --- a/src/act-compat.lua +++ b/src/act-compat.lua @@ -1,17 +1,15 @@ -- ROBLOX upstream: https://github.com/testing-library/react-testing-library/blob/v12.1.5/src/act-compat.js -local Packages = script.Parent.Parent - -local LuauPolyfill = require(Packages.LuauPolyfill) +local LuauPolyfill = require("@pkg/@jsdotlua/luau-polyfill") local console = LuauPolyfill.console type Promise = LuauPolyfill.Promise -local Promise = require(Packages.Promise) +local Promise = require("@pkg/@jsdotlua/promise") local exports = {} --- local React = require(Packages.React) --- local ReactDOM = require(Packages["react-dom"]).default -local testUtils = require(script.Parent.jsHelpers["react-dom"]["test-utils"]) +-- local React = require("@pkg/@jsdotlua/react") +-- local ReactDOM = require("@pkg/react-dom").default +local testUtils = require("./jsHelpers/react-dom/test-utils") local reactAct = testUtils.act local actSupported = reactAct ~= nil @@ -118,11 +116,12 @@ local function asyncAct(cb) cbReturn:andThen(function() -- a faux-version. -- todo - copy https://github.com/facebook/react/blob/master/packages/shared/enqueueTask.js - Promise.resolve():andThen(function() + local function andThenResolve() -- use sync act to flush effects act(function() end) resolve() - end) + end + Promise.resolve():andThen(andThenResolve) end, reject) end end) diff --git a/src/fire-event.lua b/src/fire-event.lua index d109097..2b5cc3e 100644 --- a/src/fire-event.lua +++ b/src/fire-event.lua @@ -1,14 +1,12 @@ -- ROBLOX upstream: https://github.com/testing-library/react-testing-library/blob/v12.1.5/src/fire-event.js -local Packages = script.Parent.Parent - -local LuauPolyfill = require(Packages.LuauPolyfill) +local LuauPolyfill = require("@pkg/@jsdotlua/luau-polyfill") local Array = LuauPolyfill.Array local Object = LuauPolyfill.Object type Object = LuauPolyfill.Object local exports = {} -local dtlFireEvent = require(Packages.DomTestingLibrary).fireEvent +local dtlFireEvent = require("@pkg/@jsdotlua/dom-testing-library").fireEvent -- react-testing-library's version of fireEvent will call -- dom-testing-library's version of fireEvent. The reason diff --git a/src/init.lua b/src/init.lua index 0aa6285..5aad617 100644 --- a/src/init.lua +++ b/src/init.lua @@ -1,18 +1,15 @@ -- ROBLOX upstream: https://github.com/testing-library/react-testing-library/blob/v12.1.5/src/index.js -local Packages = script.Parent - -local JestGlobals = require(Packages.JestGlobals) +local JestGlobals = require("@pkg/@jsdotlua/jest-globals") local afterEach = JestGlobals.afterEach -local LuauPolyfill = require(Packages.LuauPolyfill) +local LuauPolyfill = require("@pkg/@jsdotlua/luau-polyfill") local Object = LuauPolyfill.Object -local jsHelpers = script.jsHelpers -local isCallable = require(jsHelpers.isCallable) +local isCallable = require("./jsHelpers/isCallable") local exports = {} :: { [string]: any } -local cleanup = require(script.pure).cleanup +local cleanup = require("./pure").cleanup -- if we're running in a test runner that supports afterEach -- or teardown then we'll automatically run cleanup afterEach test -- this ensures that tests run in isolation from each other @@ -41,10 +38,10 @@ then end end -Object.assign(exports, require(script.pure)) +Object.assign(exports, require("./pure")) -- ROBLOX deviation START: reexport types -local typesModule = require(script.types) +local typesModule = require("./types") export type within = typesModule.within export type QueryByBoundAttribute = typesModule.QueryByBoundAttribute export type AllByBoundAttribute = typesModule.AllByBoundAttribute diff --git a/src/jest.config.lua b/src/jest.config.lua index 104c63e..2ca36e0 100644 --- a/src/jest.config.lua +++ b/src/jest.config.lua @@ -1,6 +1,6 @@ -local Packages = script.Parent.Parent +local ServerScriptService = game:GetService("ServerScriptService") -local TestsSetup = Packages:FindFirstChild("TestsSetup") +local TestsSetup = ServerScriptService:FindFirstChild("TestsSetup") assert(TestsSetup, "TestsSetup folder not found. Please make sure the folder exists in the root of the package.") local SetupEnv = TestsSetup:FindFirstChild("setup-env") diff --git a/src/jsHelpers/.robloxrc b/src/jsHelpers/.robloxrc deleted file mode 100644 index 4231d32..0000000 --- a/src/jsHelpers/.robloxrc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": { - "mode": "strict" - }, - "lint": { - "*": "enabled" - } -} diff --git a/src/jsHelpers/jest-dom.lua b/src/jsHelpers/jest-dom.lua index a0c0530..4983a6c 100644 --- a/src/jsHelpers/jest-dom.lua +++ b/src/jsHelpers/jest-dom.lua @@ -1,10 +1,9 @@ -- ROBLOX upstream: no upstream --[[ - ROBLOX comment: + ROBLOX comment: reduce deviations by adding matchers based on testing-library/jest-dom ]] -local Packages = script.Parent.Parent.Parent -local document = require(Packages.DomTestingLibrary).document +local document = require("@pkg/@jsdotlua/dom-testing-library").document local exports = {} diff --git a/src/jsHelpers/matchers.lua b/src/jsHelpers/matchers.lua index d71d1ef..60c4e98 100644 --- a/src/jsHelpers/matchers.lua +++ b/src/jsHelpers/matchers.lua @@ -1,6 +1,5 @@ -- ROBLOX upstream: no upstream -local Packages = script.Parent.Parent.Parent -local LuauPolyfill = require(Packages.LuauPolyfill) +local LuauPolyfill = require("@pkg/@jsdotlua/luau-polyfill") local Array = LuauPolyfill.Array local exports = {} diff --git a/src/jsHelpers/react-dom/test-utils/ReactTestUtilsPublicAct.lua b/src/jsHelpers/react-dom/test-utils/ReactTestUtilsPublicAct.lua index f0fbab3..b92b1e2 100644 --- a/src/jsHelpers/react-dom/test-utils/ReactTestUtilsPublicAct.lua +++ b/src/jsHelpers/react-dom/test-utils/ReactTestUtilsPublicAct.lua @@ -8,30 +8,28 @@ ]] -local Packages = script.Parent.Parent.Parent.Parent.Parent - -local LuauPolyfill = require(Packages.LuauPolyfill) +local LuauPolyfill = require("@pkg/@jsdotlua/luau-polyfill") local Boolean = LuauPolyfill.Boolean local console = LuauPolyfill.console -local Promise = require(Packages.Promise) +local Promise = require("@pkg/@jsdotlua/promise") local exports = {} -- ROBLOX deviation: Thenable type comes from Shared in roact-alignment -- local ReactFiberWorkLoopModule = require(Packages["react-reconciler"].src.ReactFiberWorkLoop) -local Shared = require(Packages.Shared) +local Shared = require("@pkg/@jsdotlua/shared") type Thenable = Shared.Thenable -- ROBLOX deviation: Not converting all of ReactDOM --- local ReactDOM = require(Packages["react-dom"]).default +-- local ReactDOM = require("@pkg/react-dom").default local ReactSharedInternals = Shared.ReactSharedInternals local enqueueTask = Shared.enqueueTask -local Scheduler = require(Packages.Scheduler) +local Scheduler = require("@pkg/@jsdotlua/scheduler") -- Keep in sync with ReactDOM.js, and ReactTestUtils.js: -local ReactRoblox = require(Packages.ReactRoblox) +local ReactRoblox = require("@pkg/@jsdotlua/react-roblox") local EventInternals = ReactRoblox.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Events -- ROBLOX deviation: EventInternals is a table in Lua local IsThisRendererActing = EventInternals.IsThisRendererActing @@ -43,7 +41,7 @@ local IsSomeRendererActing = ReactSharedInternals.IsSomeRendererActing -- ROBLOX deviation: use realDelay in place of enqueueTask as a fallback to -- avoid trouble caused by fake timers -local realDelay = require(script.Parent["realTaskDelay.roblox.global"]) +local realDelay = require("./realTaskDelay.roblox.global.lua") -- This is the public version of `ReactTestUtils.act`. It is implemented in -- "userspace" (i.e. not the reconciler), so that it doesn't add to the diff --git a/src/jsHelpers/react-dom/test-utils/init.lua b/src/jsHelpers/react-dom/test-utils/init.lua index 0dc22f2..6bb15bc 100644 --- a/src/jsHelpers/react-dom/test-utils/init.lua +++ b/src/jsHelpers/react-dom/test-utils/init.lua @@ -1,7 +1,7 @@ -- ROBLOX deviation: no upstream local exports = {} -local act = require(script.ReactTestUtilsPublicAct).default +local act = require("./ReactTestUtilsPublicAct").default exports.act = act return exports diff --git a/src/pure.lua b/src/pure.lua index 7bd8a60..deeecb8 100644 --- a/src/pure.lua +++ b/src/pure.lua @@ -1,7 +1,5 @@ -- ROBLOX upstream: https://github.com/testing-library/react-testing-library/blob/v12.1.5/src/pure.js -local Packages = script.Parent.Parent - -local LuauPolyfill = require(Packages.LuauPolyfill) +local LuauPolyfill = require("@pkg/@jsdotlua/luau-polyfill") local Error = LuauPolyfill.Error local Array = LuauPolyfill.Array local Object = LuauPolyfill.Object @@ -9,21 +7,21 @@ local Set = LuauPolyfill.Set local console = LuauPolyfill.console type Object = LuauPolyfill.Object -local Promise = require(Packages.Promise) -local ReactRoblox = require(Packages.ReactRoblox) +local Promise = require("@pkg/@jsdotlua/promise") +local ReactRoblox = require("@pkg/@jsdotlua/react-roblox") local exports = {} -local React = require(Packages.React) --- local ReactDOM = require(Packages["react-dom"]).default -local domModule = require(Packages.DomTestingLibrary) +local React = require("@pkg/@jsdotlua/react") +-- local ReactDOM = require("@pkg/react-dom").default +local domModule = require("@pkg/@jsdotlua/dom-testing-library") local getQueriesForElement = domModule.getQueriesForElement local prettyDOM = domModule.prettyDOM local configureDTL = domModule.configure -local act_compatModule = require(script.Parent["act-compat"]) +local act_compatModule = require("./act-compat") local act = act_compatModule.default local asyncAct = act_compatModule.asyncAct -local fireEvent = require(script.Parent["fire-event"]).fireEvent +local fireEvent = require("./fire-event").fireEvent -- ROBLOX deviation START: predefine variable local cleanupAtContainer @@ -165,7 +163,7 @@ function cleanupAtContainer(container) end -- just re-export everything from dom-testing-library -Object.assign(exports, require(Packages.DomTestingLibrary)) +Object.assign(exports, require("@pkg/@jsdotlua/dom-testing-library")) exports.render = render exports.cleanup = cleanup exports.act = act diff --git a/src/types/.robloxrc b/src/types/.robloxrc deleted file mode 100644 index 4231d32..0000000 --- a/src/types/.robloxrc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": { - "mode": "strict" - }, - "lint": { - "*": "enabled" - } -} diff --git a/src/types/init.lua b/src/types/init.lua index 745a3a0..08ba92e 100644 --- a/src/types/init.lua +++ b/src/types/init.lua @@ -1,6 +1,5 @@ -- ROBLOX upstream: https://github.com/testing-library/react-testing-library/blob/v12.1.5/types/index.d.ts -local Packages = script.Parent.Parent -local LuauPolyfill = require(Packages.LuauPolyfill) +local LuauPolyfill = require("@pkg/@jsdotlua/luau-polyfill") local Object = LuauPolyfill.Object type Array = LuauPolyfill.Array type Object = LuauPolyfill.Object @@ -12,15 +11,15 @@ type React_JSXElementConstructor = any local exports = {} -- TypeScript Version: 3.8 -local domModule = require(Packages.DomTestingLibrary) +local domModule = require("@pkg/@jsdotlua/dom-testing-library") local queries = domModule.queries type typeofQueries = typeof(queries) -- ROBLOX deviation START: ReactDOM not available type Renderer = any -- ROBLOX deviation END -local reactAct = require(script.Parent.jsHelpers["react-dom"]["test-utils"]).act -Object.assign(exports, require(Packages.DomTestingLibrary)) +local reactAct = require("../jsHelpers/react-dom/test-utils").act +Object.assign(exports, require("@pkg/@jsdotlua/dom-testing-library")) export type within = domModule.within export type QueryByBoundAttribute = domModule.QueryByBoundAttribute diff --git a/stylua.toml b/stylua.toml new file mode 100644 index 0000000..bfd71ed --- /dev/null +++ b/stylua.toml @@ -0,0 +1,8 @@ +column_width = 120 +quote_style = "AutoPreferDouble" +indent_type = "Tabs" +line_endings = "Unix" +indent_width = 4 + +[sort_requires] +enabled = true diff --git a/test-place.project.json b/test-place.project.json new file mode 100644 index 0000000..1bdae0a --- /dev/null +++ b/test-place.project.json @@ -0,0 +1,32 @@ +{ + "name": "test-place", + "tree": { + "$className": "DataModel", + "ReplicatedStorage": { + "node_modules": { + "$path": "./node_modules" + }, + "TestTarget": { + "$path": "./src" + } + }, + "ServerScriptService": { + "RunTests": { + "$path": "./scripts/roblox-test.server.lua" + }, + "TestsSetup": { + "$path": "./tests" + } + }, + "HttpService": { + "$properties": { + "HttpEnabled": true + } + }, + "Players": { + "$properties": { + "CharacterAutoLoads": false + } + } + } +} diff --git a/tests.project.json b/tests.project.json deleted file mode 100644 index bd31d14..0000000 --- a/tests.project.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "ReactTestingLibraryTestModel", - "tree": { - "$className": "DataModel", - - "HttpService": { - "$className": "HttpService", - "$properties": { - "HttpEnabled": true - } - }, - "ReplicatedStorage": { - "$className": "ReplicatedStorage", - "Packages": { - "$path": "Packages", - "ReactTestingLibrary": { - "$path": "src" - }, - "TestsSetup": { - "$path": "tests" - } - } - } - } -} diff --git a/tests/setup-env.lua b/tests/setup-env.lua index c4abafe..7feb1f8 100644 --- a/tests/setup-env.lua +++ b/tests/setup-env.lua @@ -1,22 +1,21 @@ -- ROBLOX upstream: https://github.com/testing-library/react-testing-library/blob/v12.1.5/tests/setup-env.js -local Packages = script.Parent.Parent -local LuauPolyfill = require(Packages.LuauPolyfill) +local LuauPolyfill = require("@pkg/@jsdotlua/luau-polyfill") local console = LuauPolyfill.console -local JestGlobals = require(Packages.JestGlobals) +local JestGlobals = require("@pkg/@jsdotlua/jest-globals") local jest = JestGlobals.jest local expect = JestGlobals.expect local afterEach = JestGlobals.afterEach local beforeEach = JestGlobals.beforeEach -- ROBLOX deviation START: explicitly extend expect -local jestDomMatchers = require(Packages.ReactTestingLibrary.jsHelpers["jest-dom"]) +local jestDomMatchers = require("../src/jsHelpers/jest-dom") expect.extend(jestDomMatchers) -- ROBLOX deviation END -- ROBLOX deviation START: extend with missing matchers from jest -local matchers = require(Packages.ReactTestingLibrary.jsHelpers.matchers) +local matchers = require("../src/jsHelpers/matchers") expect.extend(matchers) -- ROBLOX deviation END @@ -24,15 +23,10 @@ local consoleErrorMock -- ROBLOX deviation START: replace spyOn and String.indexof (both unavailable) local originalConsoleError = console.error beforeEach(function() - consoleErrorMock = jest.fn(function( - message, - ...: any - ) + consoleErrorMock = jest.fn(function(message, ...: any) local optionalParams = table.pack(...) -- Ignore ReactDOM.render/ReactDOM.hydrate deprecation warning - if - string.find(message, "Use createRoot instead.", 1, true) - then + if string.find(message, "Use createRoot instead.", 1, true) then return end originalConsoleError(message, table.unpack(optionalParams)) diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 0000000..ea335de --- /dev/null +++ b/yarn.lock @@ -0,0 +1,681 @@ +# This file is generated by running "yarn install" inside your project. +# Manual changes might be lost - proceed with caution! + +__metadata: + version: 8 + cacheKey: 10c0 + +"@jsdotlua/boolean@npm:^1.2.6": + version: 1.2.6 + resolution: "@jsdotlua/boolean@npm:1.2.6" + dependencies: + "@jsdotlua/number": "npm:^1.2.6" + checksum: 10c0/5f567e556bb7c56102327a97468571522ce939be6cdc1b51591afc3dfc1dff4b2c9ec5462e7809bd9a515b3bdfc1c3eaabb4f631892cb5f471b4fc8da188cb84 + languageName: node + linkType: hard + +"@jsdotlua/chalk@npm:^0.2.1": + version: 0.2.1 + resolution: "@jsdotlua/chalk@npm:0.2.1" + checksum: 10c0/4db0d7de47dae83daa8be4cb4acbb8cc54e81aa598a686529bd95e95900f365edab65fc354c6114be942cfc8c2f3efc47b78aebc528cd2079e0c67f7e4aeba8d + languageName: node + linkType: hard + +"@jsdotlua/collections@npm:^1.2.6": + version: 1.2.6 + resolution: "@jsdotlua/collections@npm:1.2.6" + dependencies: + "@jsdotlua/es7-types": "npm:^1.2.6" + "@jsdotlua/instance-of": "npm:^1.2.6" + checksum: 10c0/a4b3fe826358484528f10e8ca61a80d841a6515a22277a003117449da66ea1fb891c7b4103b952b01bd7d75666f26cb41c8efb852672aa8aaaaebbcd656dca79 + languageName: node + linkType: hard + +"@jsdotlua/console@npm:^1.2.6": + version: 1.2.6 + resolution: "@jsdotlua/console@npm:1.2.6" + dependencies: + "@jsdotlua/collections": "npm:^1.2.6" + checksum: 10c0/eff658d9e8d23f932893facf18400a29ada54d1a24748b751aac1e4df48e92ff70b3b2ccd1ab6a4f2490dd709f826fe39427fb80f01a7574265fdd4e8af9187a + languageName: node + linkType: hard + +"@jsdotlua/diff-sequences@npm:^3.6.1-rc.2": + version: 3.6.1-rc.2 + resolution: "@jsdotlua/diff-sequences@npm:3.6.1-rc.2" + dependencies: + "@jsdotlua/luau-polyfill": "npm:^1.2.6" + checksum: 10c0/8131dfffd336cfd7a2d38d974145156163c85c13bfc5dc4d36cb9d3735ffaa977751782dfca2d119dccc00badbf1120eef2d399586a5748329da7137030dda01 + languageName: node + linkType: hard + +"@jsdotlua/dom-testing-library@npm:^8.14.2-rc.1": + version: 8.14.2-rc.1 + resolution: "@jsdotlua/dom-testing-library@npm:8.14.2-rc.1" + dependencies: + "@jsdotlua/chalk": "npm:^0.2.1" + "@jsdotlua/jest-get-type": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-globals": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-roblox-shared": "npm:^3.6.1-rc.2" + "@jsdotlua/luau-polyfill": "npm:^1.2.6" + "@jsdotlua/pretty-format": "npm:^3.6.1-rc.2" + "@jsdotlua/promise": "npm:^3.5.0" + luau-regexp: "npm:^0.2.1" + checksum: 10c0/a9f7cd869e0cb543ca8d005cfc4ef654746d843229e1e9e21f98315b7046df02aea2a75a612f0d47cac507b20a80c5e1f6502fea7c4a6b761bcddd958f107dc4 + languageName: node + linkType: hard + +"@jsdotlua/emittery@npm:^3.6.1-rc.2": + version: 3.6.1-rc.2 + resolution: "@jsdotlua/emittery@npm:3.6.1-rc.2" + dependencies: + "@jsdotlua/luau-polyfill": "npm:^1.2.6" + "@jsdotlua/promise": "npm:^3.5.0" + checksum: 10c0/b7093886298b74837a4fa265c197419579cab06e2d9353ce752f5013bd8a05e29be35865a6ef66258ea2d45af046c7c98e24520489ba54729b5ea682c22a8466 + languageName: node + linkType: hard + +"@jsdotlua/es7-types@npm:^1.2.6": + version: 1.2.6 + resolution: "@jsdotlua/es7-types@npm:1.2.6" + checksum: 10c0/e5710f5f6de0608aec22744845e3a24acc47e2bda6cfc0b1fe4040935039b73e8467da90c3a6c9d75b08c9f39d2b98e9d72d54f3f630012538a7d53ad828a0d6 + languageName: node + linkType: hard + +"@jsdotlua/expect@npm:^3.6.1-rc.2": + version: 3.6.1-rc.2 + resolution: "@jsdotlua/expect@npm:3.6.1-rc.2" + dependencies: + "@jsdotlua/jest-get-type": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-matcher-utils": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-message-util": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-roblox-shared": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-snapshot": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-util": "npm:^3.6.1-rc.2" + "@jsdotlua/luau-polyfill": "npm:^1.2.6" + "@jsdotlua/promise": "npm:^3.5.0" + luau-regexp: "npm:^0.2.1" + checksum: 10c0/7733242b925f053095321427bf082a387c4d2220ea6f64830d8849837792c362cc7dc81ef8563905733aa4811ffb1dc6764f3093dc5bc2eb5a7850e53e8e5a84 + languageName: node + linkType: hard + +"@jsdotlua/instance-of@npm:^1.2.6": + version: 1.2.6 + resolution: "@jsdotlua/instance-of@npm:1.2.6" + checksum: 10c0/0958caf214bb0556c1dcf94096410c367f413af4b02ef3adbd733e47435d8734b583217804bed5aec8308d56ccfb39032bb12fd4337e01ec5ae2db690b2ca9ce + languageName: node + linkType: hard + +"@jsdotlua/jest-circus@npm:^3.6.1-rc.2": + version: 3.6.1-rc.2 + resolution: "@jsdotlua/jest-circus@npm:3.6.1-rc.2" + dependencies: + "@jsdotlua/chalk": "npm:^0.2.1" + "@jsdotlua/expect": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-each": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-environment": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-matcher-utils": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-message-util": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-roblox-shared": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-runtime": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-snapshot": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-test-result": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-types": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-util": "npm:^3.6.1-rc.2" + "@jsdotlua/luau-polyfill": "npm:^1.2.6" + "@jsdotlua/pretty-format": "npm:^3.6.1-rc.2" + "@jsdotlua/promise": "npm:^3.5.0" + "@jsdotlua/throat": "npm:^3.6.1-rc.2" + luau-regexp: "npm:^0.2.1" + checksum: 10c0/9afc7a29c871fd5e6ebf330dd9e428e3570b4d9581e248c24edae93a1e54fa917e41173cbd7672c1fea8fd6d7e4ee06b23fb8199bd5f87e726b50fd4d652fe49 + languageName: node + linkType: hard + +"@jsdotlua/jest-config@npm:^3.6.1-rc.2": + version: 3.6.1-rc.2 + resolution: "@jsdotlua/jest-config@npm:3.6.1-rc.2" + dependencies: + "@jsdotlua/chalk": "npm:^0.2.1" + "@jsdotlua/jest-each": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-environment-roblox": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-get-type": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-message-util": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-roblox-shared": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-types": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-util": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-validate": "npm:^3.6.1-rc.2" + "@jsdotlua/luau-polyfill": "npm:^1.2.6" + "@jsdotlua/promise": "npm:^3.5.0" + luau-regexp: "npm:^0.2.1" + checksum: 10c0/91cdb06da5681c05328cd1e0796c98b0685a7bc766fc5d3190718a79d6755b717598aee8189511947629e903568776e66fffc01bf4b2436c7df2a4fc611ee359 + languageName: node + linkType: hard + +"@jsdotlua/jest-console@npm:^3.6.1-rc.2": + version: 3.6.1-rc.2 + resolution: "@jsdotlua/jest-console@npm:3.6.1-rc.2" + dependencies: + "@jsdotlua/chalk": "npm:^0.2.1" + "@jsdotlua/jest-each": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-message-util": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-mock": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-roblox-shared": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-types": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-util": "npm:^3.6.1-rc.2" + "@jsdotlua/luau-polyfill": "npm:^1.2.6" + checksum: 10c0/b3430756752f1b9df7682fe1bb8c4343e4638ebc0cff0251276049138232045f20f06ef2f3a029758c9d4c40c001b70904b80ebb798c5d251a2fabd90d5866a4 + languageName: node + linkType: hard + +"@jsdotlua/jest-core@npm:^3.6.1-rc.2": + version: 3.6.1-rc.2 + resolution: "@jsdotlua/jest-core@npm:3.6.1-rc.2" + dependencies: + "@jsdotlua/chalk": "npm:^0.2.1" + "@jsdotlua/emittery": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-config": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-console": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-message-util": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-reporters": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-roblox-shared": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-runner": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-runtime": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-snapshot": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-test-result": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-types": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-util": "npm:^3.6.1-rc.2" + "@jsdotlua/luau-polyfill": "npm:^1.2.6" + "@jsdotlua/pretty-format": "npm:^3.6.1-rc.2" + "@jsdotlua/promise": "npm:^3.5.0" + luau-regexp: "npm:^0.2.1" + checksum: 10c0/8294c3bd8328445ebced024d0094f11e427ffdcc3f4e19b4b0728d963ff44864edf90572d53d2f0d922554b72282439df76e2e74ce8357b98607c51483440c90 + languageName: node + linkType: hard + +"@jsdotlua/jest-diff@npm:^3.6.1-rc.2": + version: 3.6.1-rc.2 + resolution: "@jsdotlua/jest-diff@npm:3.6.1-rc.2" + dependencies: + "@jsdotlua/chalk": "npm:^0.2.1" + "@jsdotlua/diff-sequences": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-get-type": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-types": "npm:^3.6.1-rc.2" + "@jsdotlua/luau-polyfill": "npm:^1.2.6" + "@jsdotlua/pretty-format": "npm:^3.6.1-rc.2" + checksum: 10c0/e7bd52319e178212ca696bd3c47c3ced5251bf4e62ac57a0e4bfdda79c648c2ce815da34b0423ddcbe0fc260bc595ee5ea4ac1300e1052c8a60e0d3d23217ac5 + languageName: node + linkType: hard + +"@jsdotlua/jest-each@npm:^3.6.1-rc.2": + version: 3.6.1-rc.2 + resolution: "@jsdotlua/jest-each@npm:3.6.1-rc.2" + dependencies: + "@jsdotlua/chalk": "npm:^0.2.1" + "@jsdotlua/jest-get-type": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-types": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-util": "npm:^3.6.1-rc.2" + "@jsdotlua/luau-polyfill": "npm:^1.2.6" + "@jsdotlua/pretty-format": "npm:^3.6.1-rc.2" + luau-regexp: "npm:^0.2.1" + checksum: 10c0/91d37f0a6e2fb291f229aabc5f7b0e839827e8751f3fd33a4754ffda51b325d9dd814d518753cb47c8dcad3ae249e3b881d0ffd0aa21a6af74afdb27a67a779d + languageName: node + linkType: hard + +"@jsdotlua/jest-environment-roblox@npm:^3.6.1-rc.2": + version: 3.6.1-rc.2 + resolution: "@jsdotlua/jest-environment-roblox@npm:3.6.1-rc.2" + dependencies: + "@jsdotlua/jest-environment": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-fake-timers": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-mock": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-types": "npm:^3.6.1-rc.2" + "@jsdotlua/luau-polyfill": "npm:^1.2.6" + "@jsdotlua/promise": "npm:^3.5.0" + checksum: 10c0/0ad8b4fb6a140577091d188c4c441109532b638054380c6cd102276fcd835c771d807d6017d72aaa486ca390294adbc42afa6d8471c3ea826bec7914668bfe06 + languageName: node + linkType: hard + +"@jsdotlua/jest-environment@npm:^3.6.1-rc.2": + version: 3.6.1-rc.2 + resolution: "@jsdotlua/jest-environment@npm:3.6.1-rc.2" + dependencies: + "@jsdotlua/jest-fake-timers": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-mock": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-types": "npm:^3.6.1-rc.2" + "@jsdotlua/luau-polyfill": "npm:^1.2.6" + checksum: 10c0/9174d88955fd68380bae0118e8600547c62816d006ba070a7397a7d0cd70a88403e3d7c1407d5da1da0e5b6aa8799ca12e4c2ec92ec9796de29201a4c9e4acba + languageName: node + linkType: hard + +"@jsdotlua/jest-fake-timers@npm:^3.6.1-rc.2": + version: 3.6.1-rc.2 + resolution: "@jsdotlua/jest-fake-timers@npm:3.6.1-rc.2" + dependencies: + "@jsdotlua/jest-get-type": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-mock": "npm:^3.6.1-rc.2" + "@jsdotlua/luau-polyfill": "npm:^1.2.6" + checksum: 10c0/5650e726c80be8fe04fa1b6bcd2a3aee66b146ebbccd102b1c5416516bee5dff284e13f098aba163e01672a82f4cd6a3254d0fb208b65dd9529258b437a8c43e + languageName: node + linkType: hard + +"@jsdotlua/jest-get-type@npm:^3.6.1-rc.2": + version: 3.6.1-rc.2 + resolution: "@jsdotlua/jest-get-type@npm:3.6.1-rc.2" + dependencies: + "@jsdotlua/luau-polyfill": "npm:^1.2.6" + luau-regexp: "npm:^0.2.1" + checksum: 10c0/6216f048dc17275a321ff1f8c96788ec3bab39bb9c8894b216a2419fe7e468448e970a820751a2b64b2a60bb8ebbd5105425927a9895332c234744203659419f + languageName: node + linkType: hard + +"@jsdotlua/jest-globals@npm:^3.6.1-rc.2": + version: 3.6.1-rc.2 + resolution: "@jsdotlua/jest-globals@npm:3.6.1-rc.2" + dependencies: + "@jsdotlua/expect": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-environment": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-types": "npm:^3.6.1-rc.2" + "@jsdotlua/luau-polyfill": "npm:^1.2.6" + checksum: 10c0/d9324045c7adc930db71f586e7c886ec9b3165978b271e93d07ee0537dcb22126a414ed2efbf6b62f6aa1f7cedd687ce5b3d6f5ad55ff0470b6562421dee658d + languageName: node + linkType: hard + +"@jsdotlua/jest-matcher-utils@npm:^3.6.1-rc.2": + version: 3.6.1-rc.2 + resolution: "@jsdotlua/jest-matcher-utils@npm:3.6.1-rc.2" + dependencies: + "@jsdotlua/chalk": "npm:^0.2.1" + "@jsdotlua/jest-diff": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-get-type": "npm:^3.6.1-rc.2" + "@jsdotlua/luau-polyfill": "npm:^1.2.6" + "@jsdotlua/pretty-format": "npm:^3.6.1-rc.2" + luau-regexp: "npm:^0.2.1" + checksum: 10c0/156c6fa299c10eb1bda2f1e15f4a9de8e1f9a3a0d8982a012b7e51c17dbd3a668c882bdfb07a6910f19018cb6610700289b83736d2a8ff6c9296d50777ab7081 + languageName: node + linkType: hard + +"@jsdotlua/jest-message-util@npm:^3.6.1-rc.2": + version: 3.6.1-rc.2 + resolution: "@jsdotlua/jest-message-util@npm:3.6.1-rc.2" + dependencies: + "@jsdotlua/chalk": "npm:^0.2.1" + "@jsdotlua/jest-roblox-shared": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-types": "npm:^3.6.1-rc.2" + "@jsdotlua/luau-polyfill": "npm:^1.2.6" + "@jsdotlua/pretty-format": "npm:^3.6.1-rc.2" + luau-regexp: "npm:^0.2.1" + checksum: 10c0/48d942b4de4f6b904851e7f2e74d41a211028209d2825cef8061f14d9d0c7c760f2de62037f1b5e7c84540919c30ddd4ae333a4b1d3f72bacf28fdf7ea9c1c59 + languageName: node + linkType: hard + +"@jsdotlua/jest-mock@npm:^3.6.1-rc.2": + version: 3.6.1-rc.2 + resolution: "@jsdotlua/jest-mock@npm:3.6.1-rc.2" + dependencies: + "@jsdotlua/luau-polyfill": "npm:^1.2.6" + checksum: 10c0/e77f12ac35925cb79ac7831fcf332ff3bd5dbafb016d53d77c0efa16098732a2b14f3a5b34b2be20d903ce683773dbd39ba57cde4bad7130d9fafd0931586625 + languageName: node + linkType: hard + +"@jsdotlua/jest-reporters@npm:^3.6.1-rc.2": + version: 3.6.1-rc.2 + resolution: "@jsdotlua/jest-reporters@npm:3.6.1-rc.2" + dependencies: + "@jsdotlua/chalk": "npm:^0.2.1" + "@jsdotlua/jest-console": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-message-util": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-mock": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-roblox-shared": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-test-result": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-types": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-util": "npm:^3.6.1-rc.2" + "@jsdotlua/luau-polyfill": "npm:^1.2.6" + "@jsdotlua/path": "npm:^3.6.1-rc.2" + checksum: 10c0/90e0d034084085ed873bd10b1a5742d08b0807da1bcfe380043e7dbdfcc3f4ad0048472c65ca73a13c40d182baa5e6596dea0ec6c2898df99a413b561864ea3d + languageName: node + linkType: hard + +"@jsdotlua/jest-roblox-shared@npm:^3.6.1-rc.2": + version: 3.6.1-rc.2 + resolution: "@jsdotlua/jest-roblox-shared@npm:3.6.1-rc.2" + dependencies: + "@jsdotlua/jest-get-type": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-mock": "npm:^3.6.1-rc.2" + "@jsdotlua/luau-polyfill": "npm:^1.2.6" + checksum: 10c0/61c13286784a247ec8a0f17bd4f6a7740bd1f41277569e5dfad60072f6cdf40d5d163b67d0cbd5d1d0ca4a1c705a4eaa09e87a624709ff494c0b2c4e7af374ff + languageName: node + linkType: hard + +"@jsdotlua/jest-runner@npm:^3.6.1-rc.2": + version: 3.6.1-rc.2 + resolution: "@jsdotlua/jest-runner@npm:3.6.1-rc.2" + dependencies: + "@jsdotlua/chalk": "npm:^0.2.1" + "@jsdotlua/emittery": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-circus": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-console": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-environment": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-message-util": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-roblox-shared": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-runtime": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-test-result": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-types": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-util": "npm:^3.6.1-rc.2" + "@jsdotlua/luau-polyfill": "npm:^1.2.6" + "@jsdotlua/pretty-format": "npm:^3.6.1-rc.2" + "@jsdotlua/promise": "npm:^3.5.0" + "@jsdotlua/throat": "npm:^3.6.1-rc.2" + checksum: 10c0/3615ea2cd7056731911bfea5d82f2e133fd6fb93676867d0850ccbb1cb23d1720fddbcd7e3436d3229fc159d592d32892472b8ce622c06e677abf08d57cc2c1a + languageName: node + linkType: hard + +"@jsdotlua/jest-runtime@npm:^3.6.1-rc.2": + version: 3.6.1-rc.2 + resolution: "@jsdotlua/jest-runtime@npm:3.6.1-rc.2" + dependencies: + "@jsdotlua/emittery": "npm:^3.6.1-rc.2" + "@jsdotlua/expect": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-fake-timers": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-mock": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-snapshot": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-types": "npm:^3.6.1-rc.2" + "@jsdotlua/luau-polyfill": "npm:^1.2.6" + "@jsdotlua/promise": "npm:^3.5.0" + checksum: 10c0/280a8142a0aec3b86446b456764f536f9bf71523f564d17e4f65a6ea13d3da1fa820eeac181101370d725e3233aa22968ad4311a2c21df7db776655dbdffa444 + languageName: node + linkType: hard + +"@jsdotlua/jest-snapshot@npm:^3.6.1-rc.2": + version: 3.6.1-rc.2 + resolution: "@jsdotlua/jest-snapshot@npm:3.6.1-rc.2" + dependencies: + "@jsdotlua/chalk": "npm:^0.2.1" + "@jsdotlua/jest-diff": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-get-type": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-matcher-utils": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-roblox-shared": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-types": "npm:^3.6.1-rc.2" + "@jsdotlua/luau-polyfill": "npm:^1.2.6" + "@jsdotlua/pretty-format": "npm:^3.6.1-rc.2" + "@jsdotlua/promise": "npm:^3.5.0" + checksum: 10c0/e6fef6faf7a2696aa9f032805eebb8b82c72742bdb423c9c91bea8c6ddd7ea625554d990c2ade294a108f87bea8cd7e9ad4d59f3283a97dd72087ec99833960c + languageName: node + linkType: hard + +"@jsdotlua/jest-test-result@npm:^3.6.1-rc.2": + version: 3.6.1-rc.2 + resolution: "@jsdotlua/jest-test-result@npm:3.6.1-rc.2" + dependencies: + "@jsdotlua/jest-types": "npm:^3.6.1-rc.2" + "@jsdotlua/luau-polyfill": "npm:^1.2.6" + checksum: 10c0/f43d418941805671415c4f68581f068803079f73d4cc4757fb72f717783540c04ac02d0856d7faa7c28873d17898cf84417b695c7ca4b939bf5aa75e0353ef3f + languageName: node + linkType: hard + +"@jsdotlua/jest-types@npm:^3.6.1-rc.2": + version: 3.6.1-rc.2 + resolution: "@jsdotlua/jest-types@npm:3.6.1-rc.2" + dependencies: + "@jsdotlua/luau-polyfill": "npm:^1.2.6" + luau-regexp: "npm:^0.2.1" + checksum: 10c0/8777716c40e76d7bab203db368af2b67cfba7fccef9acc36c91150b4c25628da06e85f99b5bf207449cb3d51ea5bd9cc9fb8ede5102afa9ea3f9854a7a66570e + languageName: node + linkType: hard + +"@jsdotlua/jest-util@npm:^3.6.1-rc.2": + version: 3.6.1-rc.2 + resolution: "@jsdotlua/jest-util@npm:3.6.1-rc.2" + dependencies: + "@jsdotlua/chalk": "npm:^0.2.1" + "@jsdotlua/jest-roblox-shared": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-types": "npm:^3.6.1-rc.2" + "@jsdotlua/luau-polyfill": "npm:^1.2.6" + "@jsdotlua/picomatch": "npm:^0.4.0" + "@jsdotlua/promise": "npm:^3.5.0" + luau-regexp: "npm:^0.2.1" + checksum: 10c0/b9a5d7ba8fe9f104922f84b493efe28a0f4622658c625a4b97d7fceb8e07651dd9b0fd20c9195c2c13c47e9569e9c6e60e081ed5cb17165d2fb51f28a7ac8ea3 + languageName: node + linkType: hard + +"@jsdotlua/jest-validate@npm:^3.6.1-rc.2": + version: 3.6.1-rc.2 + resolution: "@jsdotlua/jest-validate@npm:3.6.1-rc.2" + dependencies: + "@jsdotlua/chalk": "npm:^0.2.1" + "@jsdotlua/luau-polyfill": "npm:^1.2.6" + checksum: 10c0/50e51e5d3ae790bd51132d82797d0931ab8866b945fa64b5890649074bd4fc06c6e4f6afe207ab0c4817a90d8fd2159504e5c9acb2328396de7715cea4e5a854 + languageName: node + linkType: hard + +"@jsdotlua/jest@npm:^3.6.1-rc.2": + version: 3.6.1-rc.2 + resolution: "@jsdotlua/jest@npm:3.6.1-rc.2" + dependencies: + "@jsdotlua/jest-core": "npm:^3.6.1-rc.2" + checksum: 10c0/3359aca93518fa2b66c6f98034db4a6026b278a973256949ccd9cf3f8ae7f614976de79b7863d7387188bf3322036d2b4497ed35fc74801ece5099352fa079bb + languageName: node + linkType: hard + +"@jsdotlua/luau-polyfill@npm:^1.2.6": + version: 1.2.6 + resolution: "@jsdotlua/luau-polyfill@npm:1.2.6" + dependencies: + "@jsdotlua/boolean": "npm:^1.2.6" + "@jsdotlua/collections": "npm:^1.2.6" + "@jsdotlua/console": "npm:^1.2.6" + "@jsdotlua/es7-types": "npm:^1.2.6" + "@jsdotlua/instance-of": "npm:^1.2.6" + "@jsdotlua/math": "npm:^1.2.6" + "@jsdotlua/number": "npm:^1.2.6" + "@jsdotlua/string": "npm:^1.2.6" + "@jsdotlua/timers": "npm:^1.2.6" + symbol-luau: "npm:^1.0.0" + checksum: 10c0/63265f9fde3b895400d12802929ddab5daed79efc4e2aa90325b2eea0e2b7addcf351d35ad8bb19955956e913c212408944d73b6f3126223893d17cecd24de61 + languageName: node + linkType: hard + +"@jsdotlua/math@npm:^1.2.6": + version: 1.2.6 + resolution: "@jsdotlua/math@npm:1.2.6" + checksum: 10c0/06137df2a6352d4f5c730a7cf9e2902509d36de08415a3c70d470a05669dfeaf48e4aff2d5b6885a92b8f4d19fd0294a40f147a3f39c8558e887a09eb3ccd9e0 + languageName: node + linkType: hard + +"@jsdotlua/number@npm:^1.2.6": + version: 1.2.6 + resolution: "@jsdotlua/number@npm:1.2.6" + checksum: 10c0/74541fce86f80c52f05e5d4ca774d94f08ed21619af7b575c2bb7284e24fc2b178626c9888e286459a344d662cafab74d839ec8b95dcdab551fd14754911a292 + languageName: node + linkType: hard + +"@jsdotlua/path@npm:^3.6.1-rc.2": + version: 3.6.1-rc.2 + resolution: "@jsdotlua/path@npm:3.6.1-rc.2" + dependencies: + "@jsdotlua/luau-polyfill": "npm:^1.2.6" + checksum: 10c0/60868d5161f3bfc263ebcddac8cbe83f6787f85409fc1a563ff350b9ccab05c88e934ccd7e3627ea77bd73f5e30b21dbe7d85e7a4d8445d3baf96cd42bab4877 + languageName: node + linkType: hard + +"@jsdotlua/picomatch@npm:^0.4.0": + version: 0.4.0 + resolution: "@jsdotlua/picomatch@npm:0.4.0" + dependencies: + "@jsdotlua/luau-polyfill": "npm:^1.2.6" + "@jsdotlua/promise": "npm:^3.5.0" + luau-regexp: "npm:^0.2.1" + checksum: 10c0/7ccc76cfe19974a91758adf62fc69529d05815575488c1ba31af052b0f25de24a9614fd47c6e5bf67f6c28aa8e84f3f32bb59f6cb59143bb05d41b925b3a2b0e + languageName: node + linkType: hard + +"@jsdotlua/pretty-format@npm:^3.6.1-rc.2": + version: 3.6.1-rc.2 + resolution: "@jsdotlua/pretty-format@npm:3.6.1-rc.2" + dependencies: + "@jsdotlua/chalk": "npm:^0.2.1" + "@jsdotlua/jest-get-type": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-roblox-shared": "npm:^3.6.1-rc.2" + "@jsdotlua/luau-polyfill": "npm:^1.2.6" + "@jsdotlua/react-is": "npm:^17.1.0" + luau-regexp: "npm:^0.2.1" + checksum: 10c0/c82724cf7d9f84e4a12dd24fa8a13238649a76182537cc02e973a88720bf007a538d6ffea6fdb771cae6421ceea7aa221d58f126e1ab0b54f617294e7c455dfd + languageName: node + linkType: hard + +"@jsdotlua/promise@npm:^3.5.0": + version: 3.5.0 + resolution: "@jsdotlua/promise@npm:3.5.0" + checksum: 10c0/8771dac525b8d608ad319040b742cdde8f4cbbd4a075ae02dad4d510c8ab739dabf7de40ae1b15211e3890331cf3e7d9454fdcb3ec9a08471663436c0e9ec977 + languageName: node + linkType: hard + +"@jsdotlua/react-is@npm:^17.1.0": + version: 17.1.0 + resolution: "@jsdotlua/react-is@npm:17.1.0" + dependencies: + "@jsdotlua/shared": "npm:^17.1.0" + checksum: 10c0/0133682ec6ab337f2e9e3983be484f994abe8303857dd77c351fc0f9fb7d154ba115ba5ca29460f90bd482c6bbe57a28b7ddea0f4954745aaf09d682b2939560 + languageName: node + linkType: hard + +"@jsdotlua/react-reconciler@npm:^17.1.0": + version: 17.1.0 + resolution: "@jsdotlua/react-reconciler@npm:17.1.0" + dependencies: + "@jsdotlua/luau-polyfill": "npm:^1.2.6" + "@jsdotlua/promise": "npm:^3.5.0" + "@jsdotlua/react": "npm:^17.1.0" + "@jsdotlua/scheduler": "npm:^17.1.0" + "@jsdotlua/shared": "npm:^17.1.0" + checksum: 10c0/b06a3576fc0529df8c24495abcd151779f952edbc35c0baa5ad7b657e65290fe2cb3e230404f88eb38f7280520ebcfee0440997548e919d331a3e3dd332592e0 + languageName: node + linkType: hard + +"@jsdotlua/react-roblox@npm:^17.1.0": + version: 17.1.0 + resolution: "@jsdotlua/react-roblox@npm:17.1.0" + dependencies: + "@jsdotlua/luau-polyfill": "npm:^1.2.6" + "@jsdotlua/react": "npm:^17.1.0" + "@jsdotlua/react-reconciler": "npm:^17.1.0" + "@jsdotlua/scheduler": "npm:^17.1.0" + "@jsdotlua/shared": "npm:^17.1.0" + checksum: 10c0/68ef0e5b3ee015f8516d72ef3b8d222760d6f418e059387e319a57e9a948c486d6062bda2bb64b26daccd0b4453e092251d4f5f9263c6483e4fda4724e71c41b + languageName: node + linkType: hard + +"@jsdotlua/react-testing-library@workspace:.": + version: 0.0.0-use.local + resolution: "@jsdotlua/react-testing-library@workspace:." + dependencies: + "@jsdotlua/dom-testing-library": "npm:^8.14.2-rc.1" + "@jsdotlua/jest": "npm:^3.6.1-rc.2" + "@jsdotlua/jest-globals": "npm:^3.6.1-rc.2" + "@jsdotlua/luau-polyfill": "npm:^1.2.6" + "@jsdotlua/promise": "npm:^3.5.0" + "@jsdotlua/react": "npm:^17.1.0" + "@jsdotlua/react-roblox": "npm:^17.1.0" + "@jsdotlua/scheduler": "npm:^17.1.0" + "@jsdotlua/shared": "npm:^17.1.0" + luau-regexp: "npm:^0.2.1" + npmluau: "npm:^0.1.1" + languageName: unknown + linkType: soft + +"@jsdotlua/react@npm:^17.1.0": + version: 17.1.0 + resolution: "@jsdotlua/react@npm:17.1.0" + dependencies: + "@jsdotlua/luau-polyfill": "npm:^1.2.6" + "@jsdotlua/shared": "npm:^17.1.0" + checksum: 10c0/e25ba407bcd5f9395e6c206dfcbbd2b5e53c349046363830cb1a5e65c77a7978c8c680acf8c0e3d3d50bbf91b70796380b1bc43134b7d330303bef358afc5865 + languageName: node + linkType: hard + +"@jsdotlua/scheduler@npm:^17.1.0": + version: 17.1.0 + resolution: "@jsdotlua/scheduler@npm:17.1.0" + dependencies: + "@jsdotlua/luau-polyfill": "npm:^1.2.6" + "@jsdotlua/shared": "npm:^17.1.0" + checksum: 10c0/3c04c80e6982e4bd074c0de537c8d2b768a6d10a03056e8a72b832bc591a8d507e296914bd4dedcc12dd941c9c788d63b8527e61530d2793f043363a424114cb + languageName: node + linkType: hard + +"@jsdotlua/shared@npm:^17.1.0": + version: 17.1.0 + resolution: "@jsdotlua/shared@npm:17.1.0" + dependencies: + "@jsdotlua/luau-polyfill": "npm:^1.2.6" + checksum: 10c0/23e0d4fec494e7059b116db3b89e9655cc772e19fe06f9ad92bc97a324cf8862b0f2e7aaffee89d0627c9a1abb793b254573f09860fa35caf21925a33b332376 + languageName: node + linkType: hard + +"@jsdotlua/string@npm:^1.2.6": + version: 1.2.6 + resolution: "@jsdotlua/string@npm:1.2.6" + dependencies: + "@jsdotlua/es7-types": "npm:^1.2.6" + "@jsdotlua/number": "npm:^1.2.6" + checksum: 10c0/de51c662439110642b699e4196240aa45ec4b8814f99bc606acb84dbb3f1c6889099bb722b3370f5873e06bd65c76779b5d94694309c9bdc63d324f40add2b0f + languageName: node + linkType: hard + +"@jsdotlua/throat@npm:^3.6.1-rc.2": + version: 3.6.1-rc.2 + resolution: "@jsdotlua/throat@npm:3.6.1-rc.2" + dependencies: + "@jsdotlua/luau-polyfill": "npm:^1.2.6" + "@jsdotlua/promise": "npm:^3.5.0" + checksum: 10c0/306215bdc4d7baf8ff79cece3b6038123ea7b9d4fa41eaaba4ec9f0c9c48a8ed2e82bdbc1a256b16257188a8236d84deac4131a9a15e0a40c48aa51e93e285a6 + languageName: node + linkType: hard + +"@jsdotlua/timers@npm:^1.2.6": + version: 1.2.6 + resolution: "@jsdotlua/timers@npm:1.2.6" + dependencies: + "@jsdotlua/collections": "npm:^1.2.6" + checksum: 10c0/f3ec2753894e4939f7dfdf0072517f1e769e4009b4bd882c9c6878526372753ac4b08b531e1a32c96b7bccb5bf10bb8e2f5730cbc70534da7eddc620fbccaaca + languageName: node + linkType: hard + +"commander@npm:^11.0.0": + version: 11.1.0 + resolution: "commander@npm:11.1.0" + checksum: 10c0/13cc6ac875e48780250f723fb81c1c1178d35c5decb1abb1b628b3177af08a8554e76b2c0f29de72d69eef7c864d12613272a71fabef8047922bc622ab75a179 + languageName: node + linkType: hard + +"luau-regexp@npm:^0.2.1": + version: 0.2.1 + resolution: "luau-regexp@npm:0.2.1" + checksum: 10c0/7badc4e6f9ab7753d77e49db3012c525fb85dff70930c806754edd86893a39c1afb1aba51aba00b2f456f72d7f02c6a8812a160646a05986bc6d1bfae6251494 + languageName: node + linkType: hard + +"npmluau@npm:^0.1.1": + version: 0.1.1 + resolution: "npmluau@npm:0.1.1" + dependencies: + commander: "npm:^11.0.0" + walkdir: "npm:^0.4.1" + bin: + npmluau: main.js + checksum: 10c0/9ae22c0dcff9e85c90b4da4e8c17bc51e9b567b4a417c9767d355ff68faca4f99a2934b581743ebc8729f6851d1ba5b64597312151747252e040517d1794fbca + languageName: node + linkType: hard + +"symbol-luau@npm:^1.0.0": + version: 1.0.1 + resolution: "symbol-luau@npm:1.0.1" + checksum: 10c0/ab51a77331b2d5e4666528bada17e67b26aea355257bba9e97351016cd1836bd19f372355a14cf5bef2f4d5bc6b32fe91aeb09698d7bdc079d2c61330bedf251 + languageName: node + linkType: hard + +"walkdir@npm:^0.4.1": + version: 0.4.1 + resolution: "walkdir@npm:0.4.1" + checksum: 10c0/88e635aa9303e9196e4dc15013d2bd4afca4c8c8b4bb27722ca042bad213bb882d3b9141b3b0cca6bfb274f7889b30cf58d6374844094abec0016f335c5414dc + languageName: node + linkType: hard