testing staged changes
See original GitHub issueI’ve discovered BackstopJS recently and am trying to implement it in a project with a very high ratio of dynamic content (random feeds & co).
I would like to use BackstopJS in 2 steps:
- When a developer changes a file, I could detect the modified files a-la lint-staged and run backstopjs against these files in a husky pre-push hook.
- A travis CI instance connected to the github repo would run backstopJs against all pages of the application.
Can we handle the staged testing part without using the backstop.json file (which would be used on the ci) ? I’m currently thinking of adding documentation in each component file with metas for the scenarios, eg
/*
* backstop-label: Contact page
* backstop-url: /contact/
* backstop-selectors: ["#contact"]
*/
import React, {Component} from "react";
export default class Contact extends Component {
…
}
Then I’d be able to generate the label/url/referenceUrl/selectors objects for scenarios and rewrite the backstop.json file to test staged files.
I’m hoping that you have a better suggestion to handle this use-case to avoid the inline documentation overhead.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
How to Show the Changes which Have Been Staged in Git
The git diff HEAD command shows all the changes made between the working directory and HEAD , including changes in the staging area....
Read more >git - How do I show the changes which have been staged?
This command compares your staged changes to your last commit. The command compares what is in your working directory with what is in...
Read more >2.2 Git Basics - Recording Changes to the Repository
Staging Modified Files · Let's change a file that was already tracked. · The CONTRIBUTING.md file appears under a section named “Changes not...
Read more >What are Unstaged and Staged changes in Git?
Unstaged changes are changes that are not tracked by the Git. For example, if you copy a file or modify the file. Git...
Read more >Git Staging: When to stage? What to do if modification occurs ...
The process is the following: edit, run tests, stage, commit. If you stage before the testing, chances are the tests will fail and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Got it, thanks. Closing since this looks resolved, and will reopen if I don’t manage to implement it correctly 😃
Ah, good. actually, you probably don’t even need to use an active script. Just include the
--filter=<scenarioForComponentName>
argument when invoking backstop. Way easier.