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.

testing a 'folder of files' locally.

See original GitHub issue

Is it possible to test ‘everything’ from the url provide? For example I have a load of design patterns that can be accessed via http://localhost:3000/components/preview/ … currently I need to add the pattern i want to test rather than being able to test everything all at once … is this possible?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
sturobsoncommented, Feb 19, 2017

Thanks for your pointers @garris - I’ve managed to get it working in my starter project that uses Fractal … https://github.com/sturobson/SCL

The config file is here - https://github.com/sturobson/SCL/blob/master/backstopConfig.js and I’m running all the things via gulp - https://github.com/sturobson/SCL/blob/master/gulpfile.js

I’m going to close this now - I’m hoping to do a quick write-up about this too.

2reactions
garriscommented, May 17, 2016

Ok. I understand. Yes. You can do this using a module based config file.

Instead of hard-coding your config, you would create a three step process. – Step 1: use node FS to look inside a target directory to programmatically create an array of file paths you want tested. (e.g. add any file ending in .html) – Step 2: create a new scenarios array by cloning a base scenario object for each file path you created in step 1, remember to replace the url property in each newly cloned scenario object. – Step 3: return (export) a full config object which includes the scenarios array you created in step 2.

Just remember to run npm run reference when you create new files to keep everything in sync.

Hope this helps. Please post back if you complete this script – I have had requests for this kind of thing before so, I know others would appreciate the example.

Cheers.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Testing with files and directories - Testfixtures - Read the Docs
We can test this function by passing it the temporary directory's path and then using the TempDirectory.read() method to check the files were...
Read more >
Testing using local files - Stack Overflow
Common test data that will be used by multiple packages are either placed in the application root or in $HOME .
Read more >
How to Set Up a Test Directory for Your Website - Dummies.com
A test directory is a folder you create that sits at the root level of the remote server. By uploading a copy of...
Read more >
Check Existence of Local File in R (2 Examples)
This tutorial explains how to test whether a file exists in a local directory in the R programming language. The post is structured...
Read more >
How to Write File-Based JavaScript Tests With Real Files
Hey guys, this post is about writing tests for projects that access the file system by reading and writing files to disk.
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