GithubHelp home page GithubHelp logo

error-testing's Introduction

Gatsby Error Testing

Gatsby has structured errors with specific IDs. With this suite you can test certain error messages directly with a test project, e.g. to see if the error message helps with solving the problem.

Edit error-testing

Usage (Locally)

Ensure that you have the latest LTS version of Node installed. Install yarn.

Clone the repository and run in your terminal:

yarn install

After a successful installation you can use the CLI:

yarn begin

Choose one of the testing sites. Also open this repository in your favorite code editor and go to the sites directory. Each folder in there has the name of the error ID you chosen after running yarn begin. Go into this folder and you'll have a normal Gatsby project. You could e.g. directly open this folder in your editor.

Usage (Codesandbox)

Note: This requires an account on CodeSandbox

Click on the Edit on CodeSandbox button, press Fork and let CodeSandbox do its thing. On the right side there is the Browser window and below that the Terminal, Console, Problems tabs. Click on Terminal and then on the + sign. You now should have two tabs (yarn start and /bin/bash). The /bin/bash one should be automatically selected and a new terminal window appeared. Type yarn begin + Enter.

Now you're in the same state as locally โ€” choose the correct folder inside sites and try to solve your error :)

Adding a new error

Create a new project based on the hello-world starter or copy/paste one of the existing projects inside ./sites to a new folder inside ./sites with the name being an ID from the errormap. Make sure to run a yarn install after adding/copying a site.

You'll also need to add a new option to the CLI inside ./cli/index.js with the name as the ID, message as the longer description.

error-testing's People

Contributors

lekoarts avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.