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

Improve integration tests #225

Merged
merged 13 commits into from
Oct 6, 2023
Merged

Improve integration tests #225

merged 13 commits into from
Oct 6, 2023

Conversation

WilliamBergamin
Copy link
Contributor

Summary

This PR introduces an integration test that ensure that the output files of the generation script are always valid typescript. The goal of this test is to ensure no breaking changes to the generation script are introduced inadvertently.

The integration tests are not included in the code coverage but will get executed by the CI pipeline.

testing

  1. pull this branch
  2. run deno task test to execute all tests
  3. Ensure tests/integration/schema/slack/functions/_scripts/write_function_files_test.ts gets executed
  4. run deno task coverage to execute the code coverage
  5. Follow the steps in src/schema/slack/functions/_scripts/README.md to try out the generation script and ensure everything still works

Requirements

  • I've read and understood the Contributing Guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've ran deno task test after making the changes.

@WilliamBergamin WilliamBergamin added the feature request New feature or request label Oct 5, 2023
@WilliamBergamin WilliamBergamin self-assigned this Oct 5, 2023
@WilliamBergamin WilliamBergamin requested a review from a team as a code owner October 5, 2023 15:23
Copy link
Contributor

@filmaj filmaj left a comment

Choose a reason for hiding this comment

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

Awesome! :shipit:

console.log("Updated functions module export");
}

export const _internals = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice! I've been wanting to try this pattern in our deno projects for a loooong time!

import { getSlackFunctions } from "../../../../../../src/schema/slack/functions/_scripts/src/utils.ts";

Deno.test(`write_function_files.ts ${_internals.main.name} function generates valid typescript`, async () => {
const getSlackFunctionsStub = mock.stub(
Copy link
Contributor

Choose a reason for hiding this comment

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

👨‍🍳 💋
love it

@WilliamBergamin WilliamBergamin merged commit 94858bf into main Oct 6, 2023
8 checks passed
@WilliamBergamin WilliamBergamin deleted the improve-integration-tests branch October 6, 2023 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants