question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Config: Add redwood.toml setting to disable generating tests and storybook with every generator

See original GitHub issue

Not everyone cares about tests and/or storybook so it’s kind of annoying to keep creating the files every time. Let’s add config options in redwood.toml to stop creating them during generation.

Some folks may also want to generate tests/storybook for only some component types but not others. Maybe you always want them for services, but never for pages. So perhaps there’s a global config option as well as per-type config option.

Here are a couple options for syntax:

# global setting
[generate]
tests = true
storybook = false

# per-side setting
[generate.web]
tests = true
storybook = false
[generate.api]
tests = false

# individual type setting
[generate.services]
tests = true

# more specific settings win (all web-side tests are generated, only services api-side tests are generated)
[generate]
tests = true
[generate.api]
tests = false
[generate.services]
tests = true

Another suggestion is just an array of types to generator for. By default, everything is enabled, but as soon as you add the tests or storybook key then everything becomes disabled except what’s included in the array. It seems kind of weird that just the existence of the key causes all tests to be generated or not, so maybe this isn’t the most clear option:

[generate]
tests = ["services", "cells"]
storybook = ["cells"]

For now we’re talking about defaulting to true for the global setting, so existing behavior doesn’t change.

Someone also suggested maybe after you’ve used the generators 3 or 4 times you get an extra notification after the 4th generator saying something like “Did you know you can skip test or storybook generation? See https://redwoodjs.com/docs/redwood.toml

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
jvanbaarsencommented, Feb 3, 2021

Just some sign of life; I’m still working on this, but my time is a bit limited past period

1reaction
jvanbaarsencommented, Jan 25, 2021

@mojombo In the CLI I used stories. I was planning on doing the same here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

App Configuration | RedwoodJS Docs
Configure your app with redwood.toml. ... App Configuration: redwood.toml ... Many of Redwood's generators create Jest test or Storybook files.
Read more >
Create a Reddit clone with RedwoodJS - DEV Community ‍ ‍
Let's take a look at the project structure. There are a few files in the root project. Most of them are configuration files,...
Read more >
RedwoodJS 1.0 - Learn With Jason
Redwood TOML, we'll have to peek at that. A lock file. Testing setup, a GraphQL setup. And looks like environment variables over here,...
Read more >
@nrwl/react:cypress-component-configuration | Nx
Add a Cypress component testing configuration to an existing project. ... Storybook with Cypress, then check out the storybook-configuration generator docs.
Read more >
Webpack Configuration : RedwoodJS Docs
But if you just want to configure webpack, jump to Configuring Webpack. # Redwood's Webpack Configuration Files. You can find Redwood's webpack config...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found