forked from Roblox/jest-roblox
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge latest upstream changes #16
Open
vocksel
wants to merge
19
commits into
jsdotlua:main
Choose a base branch
from
vocksel:upgrade
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Problem [APT-328](https://roblox.atlassian.net/browse/APT-328) ## Solution Align and complete implementation of `spyOn` function ## Testing Aligned a number of tests, including further tests for already-ported logic.
The type in the export is incorrect See here https://github.com/Roblox/jest-roblox-internal/blob/master/src/jest-runtime/src/init.lua#L2450 Updating and bumping to be moduleScript instead of string ---------
Updating changelog and bumping release version for 3.7.0. Needed for the vscode extension.
Mocking task.wait directly in jest as per suggestion of @LordOfSpelunky
## Problem Projects using the registry cannot consume new versions of Jest ## Solution Configre Jest to use the registry ## Testing Describe how the solution was tested (ideally unit tests). If done manually, describe the process and outcome. ## Checklist (remove if not applicable) - [ ] For new modules, has a README.md file with notes about the translation - [ ] All deviations are notated in code with `-- ROBLOX deviation: comment` - [ ] Translated files include a comment with a link to the upstream file
## Problem The `spyOn` function does not currently work with Lua globals because those tables are not mockable in the usual way. ## Solution Adds `jest.globalEnv` which can be used with `spyOn` to mock Lua globals in a test environment. Allows access to the unmocked globals as members too. ## Testing Added new unit test cases to cover API surface. ## Checklist (remove if not applicable) - [x] For new modules, has a README.md file with notes about the translation - [x] All deviations are notated in code with `-- ROBLOX deviation: comment` - [x] Translated files include a comment with a link to the upstream file
## Problem Jest assumes that all properties listed in the Roblox API are safe to index. This is not true when encountering properties that are only accessible to privileged code while Jest is running in a less privileged context, or when otherwise dealing with properties that have the potential to error on index. ## Solution Hide details of the Roblox API inside of RobloxInstance, and instead only expose 'safe' APIs that protect around all instance reads and writes, and expose only the properties which are accessible with the script's current capabilities. ## Testing Unit tests and snapshots.
Moved all jest docs links to point to the 27.x archived version of the jest docs and updated static assets correctly the docusaurus way.
…st environment (#405) ## Problem When Jest 2 users are in the midst of updating to Jest 3, they might attempt to pull in Jest 3 globals. https://roblox.slack.com/archives/C04N86WJA4R/p1721837297468429?thread_ts=1721815127.913289&cid=C04N86WJA4R ## Solution Update the JestGlobals error to include a tip about mixing Jest 2 and Jest 3. ## Testing Unit tests.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR merges the latest changes from commit 70f4243 in Roblox/jest-roblox
A new package JestMockGenv is included with these changes, and I'm hitting some build issues because of it. Seems like this package may need to be published to the jsdotlua npm scope first.
Checklist before submitting: