Skip to content
This repository was archived by the owner on May 2, 2022. It is now read-only.

Conversation

@ehmicky
Copy link
Contributor

@ehmicky ehmicky commented Sep 11, 2020

Fixes #18.

This adds some automated integration tests.

The test uses the already existing test fixture integration-test and runs it with @netlify/build. Then:

  • It checks that the manifest.json exists and is valid
  • It loads the bundled file and verify that netlifyRegistry.set() is correctly called with each handler
  • It calls each handler's onRequest() and verify they are executing correctly

The tests are performed by npm test, which is automatically run in CI (GitHub actions).
nyc is used for test coverage.

When running the tests with the environment variable DEBUG=1, the build logs from @netlify/build are printed, which allows using the tests in debugging.

@ehmicky ehmicky self-assigned this Sep 11, 2020
@ehmicky ehmicky added type: chore work needed to keep the product and development running smoothly type: feature code contributing to the implementation of a feature and/or user facing functionality and removed type: chore work needed to keep the product and development running smoothly labels Sep 11, 2020
@ehmicky ehmicky marked this pull request as draft September 11, 2020 14:12
@ehmicky ehmicky force-pushed the test/add-tests branch 14 times, most recently from ae7fbb6 to 3fadf58 Compare September 11, 2020 15:32
@ehmicky
Copy link
Contributor Author

ehmicky commented Sep 11, 2020

This is ready for review!
The tests are failing on Windows, but I created a separate issue at #36 for it, since it seems to be a bug in the source.

@ehmicky ehmicky marked this pull request as ready for review September 11, 2020 15:59
@ehmicky ehmicky mentioned this pull request Sep 11, 2020
Copy link
Contributor

@shortdiv shortdiv left a comment

Choose a reason for hiding this comment

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

Looks good, tests are passing!

@ehmicky ehmicky merged commit d5a9cad into master Sep 12, 2020
@ehmicky ehmicky deleted the test/add-tests branch September 12, 2020 13:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

type: feature code contributing to the implementation of a feature and/or user facing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add some integration tests

3 participants