Skip to content
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

Add basic smoke tests for adapter-node #807

Merged
merged 1 commit into from
Mar 31, 2021

Conversation

samccone
Copy link
Contributor

@samccone samccone commented Mar 31, 2021

Scope of the test

  • verify the server starts
  • verify it can serve a 404

Additional changes:

  • change server.js to be a function that creates the server but does not start it.
  • update build rules to build from a new index.js file that builds and
    starts the app
  • update the package type to module to enable esm imports
  • expose a way to call into server with a render function
  • add a guard clause around no static asset folder existing.

@samccone samccone force-pushed the sjs/basic-adapter-node-smoke branch 2 times, most recently from 23a74f5 to a056e19 Compare March 31, 2021 20:47
packages/adapter-node/package.json Outdated Show resolved Hide resolved
packages/adapter-node/src/server.js Outdated Show resolved Hide resolved
packages/adapter-node/src/server_base.js Outdated Show resolved Hide resolved
packages/adapter-node/src/server_base.js Outdated Show resolved Hide resolved
packages/adapter-node/src/server_base.js Outdated Show resolved Hide resolved
packages/adapter-node/tests/setup.js Outdated Show resolved Hide resolved
@samccone samccone force-pushed the sjs/basic-adapter-node-smoke branch from a056e19 to fac3f06 Compare March 31, 2021 22:11
@samccone samccone force-pushed the sjs/basic-adapter-node-smoke branch 2 times, most recently from 03fcaf2 to 66d576e Compare March 31, 2021 22:33
packages/adapter-node/package.json Show resolved Hide resolved
packages/adapter-node/src/server.js Outdated Show resolved Hide resolved
packages/adapter-node/src/server.js Outdated Show resolved Hide resolved
packages/adapter-node/tests/smoke.js Outdated Show resolved Hide resolved
packages/adapter-node/tests/smoke.js Outdated Show resolved Hide resolved
packages/adapter-node/tests/smoke.js Outdated Show resolved Hide resolved
@samccone samccone force-pushed the sjs/basic-adapter-node-smoke branch 3 times, most recently from 037a582 to 20301ec Compare March 31, 2021 23:21
* verify the server starts
* verify it can serve a 404

---

Additional changes:

- change server.js to be a function that creates the server but does not start it.
- update build rules to build from a new index.js file that builds and
starts the app
- update the package type to module to enable esm imports
- expose a way to call into server with a render function
- add a guard clause around no static asset folder existing.
- change imports in adapter-node to work with import and not require

BUG sveltejs#639
Copy link
Member

@Rich-Harris Rich-Harris left a comment

Choose a reason for hiding this comment

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

🙌

@Rich-Harris Rich-Harris merged commit 5a3f855 into sveltejs:master Mar 31, 2021
@samccone samccone deleted the sjs/basic-adapter-node-smoke branch March 31, 2021 23:28
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.

3 participants