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 "testOptions.files" support #1196

Merged
merged 2 commits into from
Oct 8, 2020
Merged

add "testOptions.files" support #1196

merged 2 commits into from
Oct 8, 2020

Conversation

FredKSchott
Copy link
Owner

@FredKSchott FredKSchott commented Oct 3, 2020

Changes

  • Needed by Better test runner for Snowpack apps #1036
  • To run tests through Snowpack's build pipeline (instead of a secondary, custom Jest build pipeline) we'll need to install dependencies for test files just like we do source files.
  • Currently, we recommend adding test files to the "exclude" config. This means they'll never be scanned.
  • Instead, we want to identify a new type of config called "testOptions.files", which tells Snowpack "don't include these in the final build, but do scan them for dependencies when in test mode"

Testing

  • TODO (will wait for first review to confirm direction)

Docs

  • Added.

@FredKSchott FredKSchott requested a review from a team as a code owner October 3, 2020 06:13
@vercel
Copy link

vercel bot commented Oct 3, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/pikapkg/snowpack/3wrxtutra
✅ Preview: https://snowpack-git-add-test-file-support.pikapkg.vercel.app

@FredKSchott FredKSchott force-pushed the add-test-file-support branch from 43804d1 to b022ee2 Compare October 5, 2020 17:56
@FredKSchott FredKSchott changed the title add "testFiles" support add "testOptions.files" support Oct 5, 2020
Copy link
Contributor

@melissamcewen melissamcewen left a comment

Choose a reason for hiding this comment

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

Looks great on the docs side

Copy link
Contributor

@gr2m gr2m 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 to me 👍🏼


Options:

- **`testOptions.files`** | `string[]` | Default: `["__tests__/**/*", "**/*.@(spec|test).*"]`
Copy link
Collaborator

@drwpow drwpow Oct 5, 2020

Choose a reason for hiding this comment

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

Just my opinion: I’d put a link here stating that this pattern uses glob’s ignore option. For me, I’m always confused what I can/can’t do when it comes to glob patterns like this (is * recursive or not? do I need to start each with a !? etc.).

Copy link
Owner Author

@FredKSchott FredKSchott Oct 6, 2020

Choose a reason for hiding this comment

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

ah agreed, but not sure if it makes sense to document the ins and out of globs each time we document something that supports globs. Maybe have some overall glob support documentation?

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.

4 participants