Skip to content

chore: add failing tests for adapter-node - #16104

Merged
Rich-Harris merged 18 commits into
mainfrom
adapter-node-test
Jun 22, 2026
Merged

Rich-Harris merged 18 commits into
mainfrom
adapter-node-test

Conversation

@teemingc

@teemingc teemingc commented Jun 20, 2026 •

Copy link
Copy Markdown
Member

related to #16092 and #16090 and #16095

This PR adds an adapter-node test app that fails due to the bugs from the issues above (both only observable after build). Also moves unit tests next to their related files.


Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with pnpm test and lint the project with pnpm lint and pnpm check

Changesets

  • If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. Changesets that add features should be minor and those that fix bugs should be patch. Please prefix changeset messages with feat:, fix:, or chore:.

Edits

  • Please ensure that 'Allow edits from maintainers' is checked. PRs without this option may be closed.

@changeset-bot

changeset-bot Bot commented Jun 20, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 2286f5f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Comment thread packages/adapter-node/tsconfig.json Outdated
@svelte-docs-bot

Copy link
Copy Markdown

Comment thread packages/adapter-node/test/apps/basic/test/basic.spec.js Outdated
@teemingc teemingc changed the title chore: add failing test for adapter-node chore: add failing tests for adapter-node Jun 20, 2026
@teemingc teemingc mentioned this pull request Jun 20, 2026
6 tasks done
Comment thread packages/adapter-node/test/apps/basic/package.json Outdated
@Conduitry

Copy link
Copy Markdown
Member

It looks like this includes tests for #16092 as well. Do you also intend to include tests for #16095?

@teemingc
teemingc marked this pull request as draft June 20, 2026 13:43
@teemingc

teemingc commented Jun 20, 2026 •

Copy link
Copy Markdown
Member Author

It looks like this includes tests for #16092 as well. Do you also intend to include tests for #16095?

Good catch. I overlooked that one. It's bedtime for now but I can take a look at it tomorrow

@teemingc

Copy link
Copy Markdown
Member Author

Ok, I've added a test for #16095 . It's a simple one that checks CSR is working since the JS assets would need to be resolved correctly.

@teemingc
teemingc marked this pull request as ready for review June 22, 2026 05:59
@elliott-with-the-longest-name-on-github

Copy link
Copy Markdown
Contributor

@teemingc should we make this a platform test so that it doesn't always have to run for every PR?

Rich-Harris pushed a commit that referenced this pull request Jun 22, 2026
closes #16090
closes #16096

This PR is an alternative to #16096
that reuses an existing pattern of storing the inlined variable in a
constant and reusing that throughout the code. The added benefit is that
we reduce the number of times the string literal appears in the build
output.

---

### Please don't delete this checklist! Before submitting the PR, please
make sure you do the following:
- [x] It's really useful if your PR references an issue where it is
discussed ahead of time. In many cases, features are absent for a
reason. For large changes, please create an RFC:
https://github.com/sveltejs/rfcs
- [x] This message body should clearly illustrate what problems it
solves.
- [x] Ideally, include a test that fails without this PR but passes with
it.
	- tests added in #16104

### Tests
- [x] Run the tests with `pnpm test` and lint the project with `pnpm
lint` and `pnpm check`

### Changesets
- [x] If your PR makes a change that should be noted in one or more
packages' changelogs, generate a changeset by running `pnpm changeset`
and following the prompts. Changesets that add features should be
`minor` and those that fix bugs should be `patch`. Please prefix
changeset messages with `feat:`, `fix:`, or `chore:`.

### Edits

- [x] Please ensure that 'Allow edits from maintainers' is checked. PRs
without this option may be closed.
Rich-Harris pushed a commit that referenced this pull request Jun 22, 2026
closes #16095

This PR adds a Rollup plugin to correct module relative paths. It worked
previously because the `import.meta.url` code was called from a file at
the root. However, bundling the entries caused Rollup to move it to a
shared chunk which lived in a nested directory. The new plugin ensures
that entries creating a relative URL resolves correctly to the root

---

### Please don't delete this checklist! Before submitting the PR, please
make sure you do the following:
- [x] It's really useful if your PR references an issue where it is
discussed ahead of time. In many cases, features are absent for a
reason. For large changes, please create an RFC:
https://github.com/sveltejs/rfcs
- [x] This message body should clearly illustrate what problems it
solves.
- [x] Ideally, include a test that fails without this PR but passes with
it.
- #16104 (comment)
adds tests

### Tests
- [x] Run the tests with `pnpm test` and lint the project with `pnpm
lint` and `pnpm check`

### Changesets
- [x] If your PR makes a change that should be noted in one or more
packages' changelogs, generate a changeset by running `pnpm changeset`
and following the prompts. Changesets that add features should be
`minor` and those that fix bugs should be `patch`. Please prefix
changeset messages with `feat:`, `fix:`, or `chore:`.

### Edits

- [x] Please ensure that 'Allow edits from maintainers' is checked. PRs
without this option may be closed.
Rich-Harris added a commit that referenced this pull request Jun 22, 2026
closes #16092

This PR tries to keep the benefits of
#16069 while ensuring the Node
adapter handler code and the user's server build output are in separate
chunks. Doing so avoids the circular dependency that causes the app to
crash on startup.

---

### Please don't delete this checklist! Before submitting the PR, please
make sure you do the following:
- [x] It's really useful if your PR references an issue where it is
discussed ahead of time. In many cases, features are absent for a
reason. For large changes, please create an RFC:
https://github.com/sveltejs/rfcs
- [x] This message body should clearly illustrate what problems it
solves.
- [x] Ideally, include a test that fails without this PR but passes with
it.
	- see #16104

### Tests
- [x] Run the tests with `pnpm test` and lint the project with `pnpm
lint` and `pnpm check`

### Changesets
- [x] If your PR makes a change that should be noted in one or more
packages' changelogs, generate a changeset by running `pnpm changeset`
and following the prompts. Changesets that add features should be
`minor` and those that fix bugs should be `patch`. Please prefix
changeset messages with `feat:`, `fix:`, or `chore:`.

### Edits

- [x] Please ensure that 'Allow edits from maintainers' is checked. PRs
without this option may be closed.

---------

Co-authored-by: Rich Harris <richard.a.harris@gmail.com>
Co-authored-by: Rich Harris <rich.harris@vercel.com>
@Rich-Harris

Copy link
Copy Markdown
Member

The test failure looks legit btw

@Rich-Harris

Copy link
Copy Markdown
Member

(they're related to #16114, which wasn't the correct fix AFAICT. Vercel bot actually clocked it earlier, but I thought it was a hallucination)

@Rich-Harris
Rich-Harris merged commit c54613f into main Jun 22, 2026
27 checks passed
@Rich-Harris
Rich-Harris deleted the adapter-node-test branch June 22, 2026 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants