Repository navigation
test: run the TestRunner suite on jasmine-core 7 from npm - #547
Draft
edusperoni wants to merge 2 commits into
Draft
edusperoni wants to merge 2 commits into
edusperoni wants to merge 2 commits into
Conversation
jasmine-core becomes a pinned root devDependency instead of a vendored copy. A new "Stage Test Runner Dependencies" phase on the TestRunner target runs tools/stage-test-runner-deps.mjs before Copy Bundle Resources, copying the package's single-file build and license into the gitignored TestRunner/app/Infrastructure/Jasmine/vendor/ so the app-folder reference bundles it. The phase finds node the same way the js2c phase does (.xcode.env / .xcode.env.local), and CI already runs `npm install` at the repo root through scripts/install-ci-deps.sh. The script rewrites a file only when its content changed, so incremental builds do not recopy the app folder.
Replaces the vendored Jasmine 2.0.1 (and its 2.0 typings) with jasmine-core 7.0.2 from the staging step. Harness: - New Infrastructure/Jasmine/boot.js: installGlobals, declaration-order runs (random: false), the quarantine specFilter and the progress beacon carry over; the async-function and fail() shims are gone because Jasmine handles both natively. - A custom object formatter keeps Jasmine's pretty-printer from throwing on null-prototype tagged objects such as module namespaces. toBe() formats its message even when it passes, so expect(ns).toBe(ns) threw. - Reporters count excluded/notApplicable specs as skipped and write suite-level (afterAll, between-spec) and run-level errors as failing JUnit testcases, so CI's verify-junit-xml sees them. The JUnit escaping no longer double-escapes entities, and stacks containing "]]>" stay inside their CDATA. Specs: - Jasmine 7 routes global `error`/`unhandledrejection` events to the running spec. Specs that raise them on purpose run under raisesGlobalErrors (Infrastructure/Jasmine/globalErrorSpy.js), a wrapper over jasmine.spyOnGlobalErrorsAsync that leaves the events uncancelled. Worker specs whose error used to be re-reported on the global scope after they finished now cancel it on the parent, and the malformed-URL HTTP loader spec waits for the import it starts. - Duplicate spec names are now a declaration error: MethodCallsTests' instance/static property pairs get the file's Instance/Static naming, a spec pasted into another spec's body is split back out, and a copied Timers spec is removed. - Bumps the shared tests to common-runtime-tests-app test/jasmine-7-compat, which makes the shared specs work on both Jasmine 2.0.1 and 7.
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
This branch has not been deployed
This file contains hidden or 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
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.
Moves the TestRunner suite from a vendored Jasmine 2.0.1 (2014) to jasmine-core 7.0.2, installed from npm instead of committed.
jasmine-core comes from npm
jasmine-coreis a pinned root devDependency (7.0.2).TestRunnertarget runstools/stage-test-runner-deps.mjsbefore Copy Bundle Resources. It copies the package's single-file build and its license intoTestRunner/app/Infrastructure/Jasmine/vendor/(gitignored), which the app-folder reference then bundles..xcode.env/.xcode.env.local, like the js2c phase. CI already runsnpm installat the repo root (scripts/install-ci-deps.sh), so no workflow changes are needed. Locally, runnpm installonce (README updated).Harness
Infrastructure/Jasmine/boot.js. It keeps declaration order (random: false; the shared Workers suite carries state between specs), the quarantinespecFilterand the suite progress beacon. The async-function andfail()shims are dropped because Jasmine now handles both.toBe()builds its message even when it passes, soexpect(ns).toBe(ns)threwvalue.toString is not a function. This is worth reporting upstream.excludedandnotApplicablespecs count as skipped.afterAll, errors raised between specs) and run-level errors are written as failing JUnit testcases, soverify-junit-xmlfails the build on them.]]>in a stack no longer breaks the CDATA block.Spec changes
Global errors. Jasmine 7 fails the running spec when a global
error/unhandledrejectionevent fires; 2.0.1 never saw those events.raisesGlobalErrors(Infrastructure/Jasmine/globalErrorSpy.js). It wrapsjasmine.spyOnGlobalErrorsAsyncand doesn't cancel the events, so listeners,preventDefault()and the__onUncaughtErrorfallback still behave as in production.import("http://")unhandled, and its rejection landed in a later RemoteModuleSecurity spec. It now waits for the import.Duplicate names are now a declaration error.
MethodCallsTests: 28 instance/static property pairs shared a name; they now use the file's…_Instance…/…_Static…scheme.MethodCallsTests: a spec that had been pasted into another spec's body is split back out.Timers.js: a copied spec is removed.Shared tests. The submodule is bumped to common-runtime-tests-app
test/jasmine-7-compat. That branch makes the shared specs version-agnostic:done(reason)failure branches fail on 2.0.1 too.The branch is not on
masteryet. Merge it there first, then point this submodule atmasterbefore merging.Testing
./run_tests.sh --keep-sim, iPhone 16 Pro / iOS 26.3:main(Jasmine 2.0.1, shareda2ccd8c)mainharness + sharedtest/jasmine-7-compat(backwards-compat check)vendor/(the phase restages it)The reporters were also checked in Node against jasmine-core 7 with a fake suite (failing,
xit, filtered,pending,afterAllerror,done(reason), async); the XML output parses.Not covered here: Android still runs Jasmine 2.0.1. Only the backwards-compatible shared changes affect it, and I did not run its suite.