Skip to content

Get types to work inside of a realm test file locally#4181

Open
tintinthong wants to merge 4 commits intomainfrom
getting-test-to-work-for-test-file
Open

Get types to work inside of a realm test file locally#4181
tintinthong wants to merge 4 commits intomainfrom
getting-test-to-work-for-test-file

Conversation

@tintinthong
Copy link
Contributor

No description provided.

@tintinthong tintinthong force-pushed the getting-test-to-work-for-test-file branch from 9832184 to c2aff15 Compare March 13, 2026 02:34
@github-actions
Copy link

github-actions bot commented Mar 13, 2026

Host Test Results

    1 files  +    1      1 suites  +1   4h 51m 24s ⏱️ + 4h 51m 24s
2 019 tests +2 019  1 997 ✅ +1 997  15 💤 +15  0 ❌ ±0  7 🔥 +7 
4 068 runs  +4 068  4 024 ✅ +4 024  30 💤 +30  7 ❌ +7  7 🔥 +7 

For more details on these errors, see this check.

Results for commit 6798b2b. ± Comparison against base commit b2f81bb.

♻️ This comment has been updated with latest results.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 98321845b0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +35 to +39
loader.shimModule('qunit', QUnit);
loader.shimModule('@cardstack/host/tests/helpers', helpers);
loader.shimModule('@cardstack/host/tests/helpers/mock-matrix', mockMatrix);
loader.shimModule('@cardstack/host/tests/helpers/setup', testSetup);
loader.shimModule('@cardstack/host/tests/helpers/adapter', helperAdapter);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Shim live-test package imports before loading realm module

loadRealmTests() only shims qunit and @cardstack/host/tests/helpers*, but the default module it imports (sample-command-card.gts) has runtime imports from @ember/service, @ember/test-helpers, and @universal-ember/test-support. In this loader stack, bare specifiers resolve to package URLs and must be shimmed, so await loader.import(${realmURL}${testModule}) will fail as soon as those imports are evaluated. Please shim those modules (or avoid runtime imports of them in the realm file) before importing the test module.

Useful? React with 👍 / 👎.

Comment on lines +50 to +51
<script src="/assets/test-support.js"></script>
<script src="/assets/@cardstack/host.js"></script>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Disable QUnit autostart before loading test-support bundle

live-test.html currently loads /assets/test-support.js before /assets/live-test.js, but test-support executes tests/test-helper.js, which unconditionally calls start() and starts QUnit immediately. That makes QUnit.config.autostart = false in live-test.js too late, so the run can start/finish before the realm module is imported (resulting in zero/missing realm tests or mixed host-suite execution). Move the live-test bootstrap (or an early autostart=false script) ahead of test-support.js.

Useful? React with 👍 / 👎.

@github-actions
Copy link

Preview deployments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant