Skip to content

Start tests for index exports (all currently fail) #5

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

Merged
merged 4 commits into from
Apr 5, 2018

Conversation

prescottprue
Copy link
Contributor

@prescottprue prescottprue commented Apr 4, 2018

Description

Started tests to confirm usage through require.

Using the library through require (as noted in docs and the examples) should be tested. It appears that all current tests only load src directly (never from top level index to confirm exports).

Code sample

Using like this should work:

// At the top of test/index.test.js
const test = require('firebase-functions-test')();
test.mockConfig({ some: { config: '' } });
test.wrap(myFunctions.makeUppercase);

@laurenzlong
Copy link
Contributor

laurenzlong commented Apr 4, 2018

Great idea! Can you:

  • make the tests more descriptive i.e. it('should export mockConfig as a function')
  • add an after function which calls cleanup

@laurenzlong laurenzlong self-requested a review April 5, 2018 22:19
Copy link
Contributor

@laurenzlong laurenzlong left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution!

@laurenzlong laurenzlong merged commit c1a254c into firebase:master Apr 5, 2018
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.

2 participants