Skip to content

Export Server #463

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* @public
*/
export * from './functions';
export * from './server';
Copy link
Contributor

Choose a reason for hiding this comment

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

This lack of re-export is intentional.

The usage should be:

import {getTestServer} from '@google-cloud/functions-framework/testing';

Or, if you are trying to get server, you can import from /server.

See docs:

https://github.com/GoogleCloudPlatform/functions-framework-nodejs/blob/master/docs/testing-functions.md

Copy link
Author

Choose a reason for hiding this comment

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

Or, if you are trying to get server, you can import from /server.

Thanks, though server isn’t currently included in the package.json exports

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes. Why do you want to import the internal server vs the test server?

Perhaps a different approach can be taken, since we can't export our internal server.

We have examples of integration tests.

Copy link
Author

@penx penx Jun 6, 2022

Choose a reason for hiding this comment

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

See my follow up comment here.

#463 (comment)

I don’t think I need this anymore as I was able to figure out how to load a function in code.

I think the docs could be updated to show how you can test a function without it existing on disk.


/**
* @public
Expand Down