├── .all-contributorsrc ├── .eslintignore ├── .eslintrc.json ├── .github ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature-enhancement-request.md ├── PULL_REQUEST_TEMPLATE.md └── config.yml ├── .gitignore ├── .husky └── pre-commit ├── .prettierignore ├── .prettierrc ├── .travis.yml ├── CODE_OF_CONDUCT.md ├── CODE_STYLE_GUIDE.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── __mocks__ ├── file-mock.js └── gatsby.js ├── gatsby-browser.js ├── gatsby-config.js ├── gatsby-node.js ├── jest-preprocess.js ├── jest.config.js ├── loadershim.js ├── package-lock.json ├── package.json ├── setupTests.js ├── src ├── components │ ├── __tests__ │ │ ├── __snapshots__ │ │ │ ├── addons.test.js.snap │ │ │ ├── donate.test.js.snap │ │ │ ├── footer.test.js.snap │ │ │ ├── header.test.js.snap │ │ │ ├── loader.test.js.snap │ │ │ ├── markdown.test.js.snap │ │ │ ├── markdownPreview.test.js.snap │ │ │ ├── skills.test.js.snap │ │ │ ├── social.test.js.snap │ │ │ ├── subtitle.test.js.snap │ │ │ ├── title.test.js.snap │ │ │ └── work.test.js.snap │ │ ├── addons.test.js │ │ ├── donate.test.js │ │ ├── footer.test.js │ │ ├── header.test.js │ │ ├── loader.test.js │ │ ├── markdown.test.js │ │ ├── markdownPreview.test.js │ │ ├── skills.test.js │ │ ├── social.test.js │ │ ├── subtitle.test.js │ │ ├── title.test.js │ │ └── work.test.js │ ├── addons.jsx │ ├── donate.jsx │ ├── footer.jsx │ ├── header.jsx │ ├── layout.jsx │ ├── loader.jsx │ ├── markdown.jsx │ ├── markdownPreview.jsx │ ├── seo.jsx │ ├── skills.jsx │ ├── social.jsx │ ├── subtitle.jsx │ ├── support.jsx │ ├── title.jsx │ └── work.jsx ├── constants │ ├── defaults.js │ ├── page-links.js │ └── skills.js ├── designs │ └── GPRG Style Guide.png ├── html.jsx ├── images │ ├── Discord-Logo.png │ ├── github-profile-readme-generator.gif │ ├── icons │ │ ├── AIML │ │ │ ├── opencv.svg │ │ │ ├── pytorch.svg │ │ │ ├── scikit.svg │ │ │ └── tensorflow.svg │ │ ├── Automation │ │ │ ├── ifttt.svg │ │ │ └── zapier.svg │ │ ├── BaaS │ │ │ ├── amplify.svg │ │ │ ├── firebase.svg │ │ │ └── heroku.svg │ │ ├── BackendDevelopment │ │ │ ├── express.svg │ │ │ ├── graphql.svg │ │ │ ├── hadoop.svg │ │ │ ├── kafka.svg │ │ │ ├── nestjs.svg │ │ │ ├── nginx.svg │ │ │ ├── nodejs.svg │ │ │ ├── openresty.svg │ │ │ ├── rabbitmq.svg │ │ │ ├── solr.svg │ │ │ └── spring.svg │ │ ├── DataVisualization │ │ │ ├── canvasjs.svg │ │ │ ├── chartjs.svg │ │ │ ├── d3js.svg │ │ │ ├── grafana.svg │ │ │ └── kibana.svg │ │ ├── Database │ │ │ ├── cassandra.svg │ │ │ ├── cockroachdb.svg │ │ │ ├── couchdb.svg │ │ │ ├── elasticsearch.svg │ │ │ ├── hive.svg │ │ │ ├── mariadb.svg │ │ │ ├── mongodb.svg │ │ │ ├── mysql.svg │ │ │ ├── oracle.svg │ │ │ ├── postgresql.svg │ │ │ ├── realm.svg │ │ │ ├── redis.svg │ │ │ └── sqlite.svg │ │ ├── Devops │ │ │ ├── aws.svg │ │ │ ├── azure.svg │ │ │ ├── bash.svg │ │ │ ├── circleci.svg │ │ │ ├── docker.svg │ │ │ ├── gcp.svg │ │ │ ├── jenkins.svg │ │ │ ├── kubernetes.svg │ │ │ ├── travisci.svg │ │ │ └── vagrant.svg │ │ ├── Framework │ │ │ ├── codeigniter.svg │ │ │ ├── django.svg │ │ │ ├── dotnet.svg │ │ │ ├── electron.svg │ │ │ ├── flask.svg │ │ │ ├── laravel.svg │ │ │ ├── quasar.svg │ │ │ ├── rails.svg │ │ │ └── symfony.svg │ │ ├── FrontendDevelopment │ │ │ ├── angularjs.svg │ │ │ ├── babel.svg │ │ │ ├── backbonejs.svg │ │ │ ├── bootstrap.svg │ │ │ ├── bulma.svg │ │ │ ├── css.svg │ │ │ ├── ember.svg │ │ │ ├── gtk.svg │ │ │ ├── gulp.svg │ │ │ ├── html.svg │ │ │ ├── materialize.svg │ │ │ ├── meteor.svg │ │ │ ├── pug.svg │ │ │ ├── qt.svg │ │ │ ├── reactjs.svg │ │ │ ├── redux.svg │ │ │ ├── sass.svg │ │ │ ├── svelte.svg │ │ │ ├── tailwind.svg │ │ │ ├── vuejs.svg │ │ │ ├── vuetify.svg │ │ │ ├── webpack.svg │ │ │ └── wxwidgets.svg │ │ ├── GameEngines │ │ │ ├── unity.svg │ │ │ └── unreal.svg │ │ ├── MobileAppDevelopment │ │ │ ├── android.svg │ │ │ ├── apachecordova.svg │ │ │ ├── dart.svg │ │ │ ├── flutter.svg │ │ │ ├── ionic.svg │ │ │ ├── kotlin.svg │ │ │ ├── nativescript.svg │ │ │ ├── reactnative.svg │ │ │ └── xamarin.svg │ │ ├── Other │ │ │ ├── arduino.svg │ │ │ ├── git.svg │ │ │ └── linux.svg │ │ ├── ProgrammingLanguages │ │ │ ├── c.svg │ │ │ ├── clojure.svg │ │ │ ├── coffeescript.svg │ │ │ ├── cpp.svg │ │ │ ├── csharp.svg │ │ │ ├── elixir.svg │ │ │ ├── erlang.svg │ │ │ ├── go.svg │ │ │ ├── haskell.svg │ │ │ ├── java.svg │ │ │ ├── javascript.svg │ │ │ ├── objectivec.svg │ │ │ ├── perl.svg │ │ │ ├── php.svg │ │ │ ├── python.svg │ │ │ ├── ruby.svg │ │ │ ├── rust.svg │ │ │ ├── scala.svg │ │ │ ├── swift.svg │ │ │ └── typescript.svg │ │ ├── Social │ │ │ ├── behance.svg │ │ │ ├── blogger.svg │ │ │ ├── codeforces.svg │ │ │ ├── codepen.svg │ │ │ ├── codesandbox.svg │ │ │ ├── devto.svg │ │ │ ├── discord.svg │ │ │ ├── dribbble.svg │ │ │ ├── dropbox.svg │ │ │ ├── envato.svg │ │ │ ├── facebook-alt.svg │ │ │ ├── facebook.svg │ │ │ ├── geeks-for-geeks.svg │ │ │ ├── github.svg │ │ │ ├── google.svg │ │ │ ├── hackerearth.svg │ │ │ ├── hackerrank.svg │ │ │ ├── hashnode.svg │ │ │ ├── instagram.svg │ │ │ ├── kaggle.svg │ │ │ ├── leet-code.svg │ │ │ ├── linked-in-alt.svg │ │ │ ├── linked-in.svg │ │ │ ├── medium.svg │ │ │ ├── messenger.svg │ │ │ ├── myspace-alt.svg │ │ │ ├── myspace.svg │ │ │ ├── path.svg │ │ │ ├── photo.svg │ │ │ ├── picasa.svg │ │ │ ├── pinterest.svg │ │ │ ├── reddit.svg │ │ │ ├── rss.svg │ │ │ ├── skype.svg │ │ │ ├── snapchat.svg │ │ │ ├── soundcloud.svg │ │ │ ├── spotify.svg │ │ │ ├── stack-overflow.svg │ │ │ ├── team.svg │ │ │ ├── topcoder.svg │ │ │ ├── tumblr.svg │ │ │ ├── twitch.svg │ │ │ ├── twitter-alt.svg │ │ │ ├── twitter.svg │ │ │ ├── viddler.svg │ │ │ ├── vimeo.svg │ │ │ ├── vine.svg │ │ │ ├── vk.svg │ │ │ ├── whatsapp.svg │ │ │ ├── wordpress.svg │ │ │ ├── yahoo.svg │ │ │ └── youtube.svg │ │ ├── Software │ │ │ ├── blender.svg │ │ │ ├── figma.svg │ │ │ ├── framer.svg │ │ │ ├── illustrator.svg │ │ │ ├── invision.svg │ │ │ ├── matlab.svg │ │ │ ├── photoshop.svg │ │ │ ├── postman.svg │ │ │ ├── sketch.svg │ │ │ ├── solidworks.svg │ │ │ └── xd.svg │ │ ├── StaticSiteGenerators │ │ │ ├── 11ty.svg │ │ │ ├── gatsby.svg │ │ │ ├── gridsome.svg │ │ │ ├── hexo.svg │ │ │ ├── hugo.svg │ │ │ ├── jekyll.svg │ │ │ ├── middleman.svg │ │ │ ├── nextjs.svg │ │ │ ├── nuxtjs.svg │ │ │ ├── sapper.svg │ │ │ ├── scully.svg │ │ │ ├── sculpin.svg │ │ │ └── vuepress.svg │ │ ├── Testing │ │ │ ├── cypress.svg │ │ │ ├── jasmine.svg │ │ │ ├── jest.svg │ │ │ ├── karma.svg │ │ │ ├── mocha.svg │ │ │ ├── puppeteer.svg │ │ │ └── selenium.svg │ │ └── mysqlworkbench.svg │ └── mdg.png ├── markdown-pages │ ├── about.md │ ├── addons.md │ └── support.md ├── pages │ ├── 404.jsx │ ├── index.css │ └── index.jsx ├── styles │ └── tailwind.css ├── templates │ └── blogTemplate.js └── utils │ ├── __tests__ │ └── validation.test.js │ ├── link-generators.js │ ├── validation.js │ └── workflows.js └── tailwind.config.js /.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules/** -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": true, 4 | "es2021": true 5 | }, 6 | "extends": ["plugin:react/recommended", "airbnb", "prettier"], 7 | "parserOptions": { 8 | "ecmaFeatures": { 9 | "jsx": true 10 | }, 11 | "ecmaVersion": 12, 12 | "sourceType": "module" 13 | }, 14 | "plugins": ["react"], 15 | "rules": { 16 | "react/forbid-prop-types": 0 17 | }, 18 | "ignorePatterns": ["**/*.test.js"] 19 | } 20 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: github-profile-readme-generator 6 | ko_fi: rahuldkjain 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: 13 | ["https://paypal.me/rahuldkjain", "https://www.buymeacoffee.com/rahuldkjain"] 14 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | --- 8 | 9 | **Describe the bug** 10 | A clear and concise description of what the bug is. 11 | 12 | **To Reproduce** 13 | Steps to reproduce the behavior: 14 | 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | 28 | - OS: [e.g. iOS] 29 | - Browser [e.g. chrome, safari] 30 | - Version [e.g. 22] 31 | 32 | **Smartphone (please complete the following information):** 33 | 34 | - Device: [e.g. iPhone6] 35 | - OS: [e.g. iOS8.1] 36 | - Browser [e.g. stock browser, safari] 37 | - Version [e.g. 22] 38 | 39 | **Additional context** 40 | Add any other context about the problem here. 41 | 42 | Join the **Discord Server** for further discussions. 43 | 44 | 45 | GPRG Discord Server Link 46 | 47 | 48 | Server Link: https://discord.gg/HHMs7Eg 49 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature-enhancement-request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature/Enhancement request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: enhancement, hacktoberfest 6 | assignees: '' 7 | --- 8 | 9 | **Is your feature request related to a problem? Please describe.** 10 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 11 | 12 | **Describe the solution you'd like** 13 | A clear and concise description of what you want to happen. 14 | 15 | **Describe alternatives you've considered** 16 | A clear and concise description of any alternative solutions or features you've considered. 17 | 18 | **Additional context** 19 | Add any other context or screenshots about the feature request here. 20 | 21 | Join the **Discord Server** for further discussions. 22 | 23 | 24 | GPRG Discord Server Link 25 | 26 | 27 | Server Link: https://discord.gg/HHMs7Eg 28 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 16 | 17 | ## What type of PR is this? (check all applicable) 18 | 19 | - [ ] Refactor 20 | - [ ] Feature 21 | - [ ] Bug Fix 22 | - [ ] Enhancement 23 | - [ ] Documentation Update 24 | 25 | ## Description 26 | 27 | ## Related Tickets & Documents 28 | 29 | ## QA Instructions, Screenshots, Recordings 30 | 31 | _Please replace this line with instructions on how to test your changes, as well 32 | as any relevant images for UI changes._ 33 | 34 | 39 | 40 | ## Added to documentation? 41 | 42 | - [ ] readme 43 | -------------------------------------------------------------------------------- /.github/config.yml: -------------------------------------------------------------------------------- 1 | # Configuration for new-issue-welcome - https://github.com/behaviorbot/new-issue-welcome 2 | 3 | # Comment to be posted to on first time issues 4 | newIssueWelcomeComment: > 5 | Thanks for opening your first issue here! Your contribution means alot. 🙌 Join Discord Server (https://discord.gg/HHMs7Eg) for discussing issues, pull-requests, new features, etc. 6 | 7 | # Configuration for new-pr-welcome - https://github.com/behaviorbot/new-pr-welcome 8 | 9 | # Comment to be posted to on PRs from first time contributors in your repository 10 | newPRWelcomeComment: > 11 | Thanks for opening this pull request! Make sure you have assigned an issue to this respective PR 😇 12 | 13 | # Configuration for first-pr-merge - https://github.com/behaviorbot/first-pr-merge 14 | 15 | # Comment to be posted to on pull requests merged by a first time user 16 | firstPRMergeComment: > 17 | Congrats on merging your first pull request🎉! Thanks alot for your contribution. 🙏 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | dist/ 2 | # Logs 3 | logs 4 | *.log 5 | npm-debug.log* 6 | yarn-debug.log* 7 | yarn-error.log* 8 | 9 | # Runtime data 10 | pids 11 | *.pid 12 | *.seed 13 | *.pid.lock 14 | 15 | # Directory for instrumented libs generated by jscoverage/JSCover 16 | lib-cov 17 | 18 | # Coverage directory used by tools like istanbul 19 | coverage 20 | 21 | # nyc test coverage 22 | .nyc_output 23 | 24 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 25 | .grunt 26 | 27 | # Bower dependency directory (https://bower.io/) 28 | bower_components 29 | 30 | # node-waf configuration 31 | .lock-wscript 32 | 33 | # Compiled binary addons (http://nodejs.org/api/addons.html) 34 | build/Release 35 | 36 | # Dependency directories 37 | node_modules/ 38 | jspm_packages/ 39 | 40 | # Typescript v1 declaration files 41 | typings/ 42 | 43 | # Optional npm cache directory 44 | .npm 45 | 46 | # Optional eslint cache 47 | .eslintcache 48 | 49 | # Optional REPL history 50 | .node_repl_history 51 | 52 | # Output of 'npm pack' 53 | *.tgz 54 | 55 | # dotenv environment variable files 56 | .env* 57 | 58 | # gatsby files 59 | .cache/ 60 | public 61 | 62 | # Mac files 63 | .DS_Store 64 | 65 | # Yarn 66 | yarn-error.log 67 | .pnp/ 68 | .pnp.js 69 | # Yarn Integrity file 70 | .yarn-integrity 71 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | npx --no-install lint-staged 5 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | .cache 2 | package.json 3 | package-lock.json 4 | public 5 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "jsxSingleQuote": false, 4 | "tabWidth": 2, 5 | "printWidth": 120, 6 | "trailingComma": "all", 7 | "semi": true, 8 | "exclude": ["node_modules", "codepipeline"] 9 | } 10 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "14" 4 | cache: 5 | directories: 6 | - "node_modules" 7 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | When contributing to this repository, please first discuss the change you wish to make via issue, 4 | email, or any other method with the owners of this repository before making a change. 5 | 6 | 7 | join discord community of github profile readme generator 8 | 9 | 10 | Please note we have a code of conduct, please follow it in all your interactions with the project. 11 | 12 | ## Pull Request Process 13 | 14 | 1. Ensure any install or build dependencies are removed before the end of the layer when doing a 15 | build. 16 | 2. Update the README.md with details of changes to the interface, this includes new environment 17 | variables, exposed ports, useful file locations and container parameters. 18 | 3. Increase the version numbers in any examples files and the README.md to the new version that this 19 | Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/). 20 | 4. You may merge the Pull Request once you have the sign-off of two other developers, or if you 21 | do not have permission to do that, you may request the second reviewer merge it for you. 22 | -------------------------------------------------------------------------------- /__mocks__/file-mock.js: -------------------------------------------------------------------------------- 1 | module.exports = 'test-file-stub'; 2 | -------------------------------------------------------------------------------- /__mocks__/gatsby.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-undef */ 2 | const React = require('react'); 3 | 4 | const gatsby = jest.requireActual('gatsby'); 5 | 6 | module.exports = { 7 | ...gatsby, 8 | graphql: jest.fn(), 9 | Link: jest.fn().mockImplementation( 10 | // these props are invalid for an `a` tag 11 | ({ activeClassName, activeStyle, getProps, innerRef, partiallyActive, ref, replace, to, ...rest }) => 12 | React.createElement('a', { 13 | ...rest, 14 | href: to, 15 | }), 16 | ), 17 | StaticQuery: jest.fn(), 18 | useStaticQuery: jest.fn(), 19 | }; 20 | -------------------------------------------------------------------------------- /gatsby-browser.js: -------------------------------------------------------------------------------- 1 | import './src/styles/tailwind.css'; 2 | require('prismjs/themes/prism-okaidia.css'); 3 | -------------------------------------------------------------------------------- /gatsby-config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | pathPrefix: `/gh-profile-readme-generator`, 3 | siteMetadata: { 4 | title: `GitHub Profile Readme Generator`, 5 | description: `Prettify your github profile using this amazing readme generator.`, 6 | author: `@rahuldkjain`, 7 | }, 8 | plugins: [ 9 | `gatsby-plugin-react-helmet`, 10 | { 11 | resolve: `gatsby-source-filesystem`, 12 | options: { 13 | name: `images`, 14 | path: `${__dirname}/src/images`, 15 | }, 16 | }, 17 | { 18 | resolve: `gatsby-source-filesystem`, 19 | options: { 20 | name: `markdown-pages`, 21 | path: `${__dirname}/src/markdown-pages`, 22 | }, 23 | }, 24 | { 25 | resolve: `gatsby-transformer-remark`, 26 | options: { 27 | plugins: [`gatsby-remark-prismjs`], 28 | }, 29 | }, 30 | `gatsby-transformer-sharp`, 31 | `gatsby-plugin-sharp`, 32 | { 33 | resolve: `gatsby-plugin-manifest`, 34 | options: { 35 | name: `gatsby-starter-default`, 36 | short_name: `starter`, 37 | start_url: `/`, 38 | background_color: `#663399`, 39 | theme_color: `#663399`, 40 | display: `minimal-ui`, 41 | icon: `src/images/mdg.png`, // This path is relative to the root of the site. 42 | }, 43 | }, 44 | { 45 | resolve: `gatsby-plugin-google-analytics`, 46 | options: { 47 | trackingId: 'UA-168596085-3', 48 | // this option places the tracking script into the head of the DOM 49 | head: true, 50 | // other options 51 | }, 52 | }, 53 | { 54 | resolve: `gatsby-plugin-postcss`, 55 | options: { 56 | postCssPlugins: [require('tailwindcss')], 57 | }, 58 | }, 59 | { 60 | resolve: `gatsby-plugin-purgecss`, 61 | options: { 62 | printRejected: false, 63 | develop: false, 64 | tailwind: true, 65 | }, 66 | }, 67 | `gatsby-plugin-twitter`, 68 | ], 69 | // this (optional) plugin enables Progressive Web App + Offline functionality 70 | // To learn more, visit: https://gatsby.dev/offline 71 | // `gatsby-plugin-offline`, 72 | }; 73 | -------------------------------------------------------------------------------- /gatsby-node.js: -------------------------------------------------------------------------------- 1 | exports.createPages = async ({ actions, graphql, reporter }) => { 2 | const { createPage } = actions; 3 | 4 | const blogPostTemplate = require.resolve(`./src/templates/blogTemplate.js`); 5 | 6 | const result = await graphql(` 7 | { 8 | allMarkdownRemark(sort: { order: DESC, fields: [frontmatter___date] }, limit: 1000) { 9 | edges { 10 | node { 11 | frontmatter { 12 | slug 13 | } 14 | } 15 | } 16 | } 17 | } 18 | `); 19 | 20 | // Handle errors 21 | if (result.errors) { 22 | reporter.panicOnBuild(`Error while running GraphQL query.`); 23 | return; 24 | } 25 | 26 | result.data.allMarkdownRemark.edges.forEach(({ node }) => { 27 | createPage({ 28 | path: node.frontmatter.slug, 29 | component: blogPostTemplate, 30 | context: { 31 | // additional data can be passed via context 32 | slug: node.frontmatter.slug, 33 | }, 34 | }); 35 | }); 36 | }; 37 | -------------------------------------------------------------------------------- /jest-preprocess.js: -------------------------------------------------------------------------------- 1 | const babelOptions = { 2 | presets: ['babel-preset-gatsby'], 3 | }; 4 | 5 | module.exports = require('babel-jest').createTransformer(babelOptions); 6 | -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | transform: { 3 | '^.+\\.jsx?$': `/jest-preprocess.js`, 4 | }, 5 | moduleNameMapper: { 6 | '.+\\.(css|styl|less|sass|scss)$': `identity-obj-proxy`, 7 | '.+\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': `/__mocks__/file-mock.js`, 8 | }, 9 | testPathIgnorePatterns: [`node_modules`, `\\.cache`, `.*/public`], 10 | transformIgnorePatterns: [`node_modules/(?!(gatsby)/)`], 11 | globals: { 12 | __PATH_PREFIX__: ``, 13 | __BASE_PATH__: ``, 14 | }, 15 | setupFiles: [`/loadershim.js`], 16 | setupFilesAfterEnv: ['/setupTests.js'], 17 | snapshotSerializers: ['enzyme-to-json/serializer'], 18 | coverageThreshold: { 19 | global: { 20 | branches: 0, 21 | functions: 75, 22 | lines: 68, 23 | statements: 68, 24 | }, 25 | }, 26 | }; 27 | -------------------------------------------------------------------------------- /loadershim.js: -------------------------------------------------------------------------------- 1 | global.___loader = { 2 | enqueue: jest.fn(), 3 | }; 4 | -------------------------------------------------------------------------------- /setupTests.js: -------------------------------------------------------------------------------- 1 | import { configure } from 'enzyme'; 2 | import Adapter from 'enzyme-adapter-react-16'; 3 | 4 | configure({ adapter: new Adapter() }); 5 | -------------------------------------------------------------------------------- /src/components/__tests__/__snapshots__/loader.test.js.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Loader renders correctly 1`] = ` 4 |
7 | 8 | ↓ 9 | 10 | 11 | ↓ 12 | 13 | 14 | ↓ 15 | 16 | 17 | ↓ 18 | 19 | 20 | ↓ 21 | 22 |
23 | `; 24 | -------------------------------------------------------------------------------- /src/components/__tests__/__snapshots__/subtitle.test.js.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Subtitle renders correctly 1`] = ` 4 |
7 |
10 | Subtitle 11 |
12 | 18 |
19 | `; 20 | -------------------------------------------------------------------------------- /src/components/__tests__/__snapshots__/title.test.js.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Title renders title component correctly 1`] = ` 4 |
7 |
10 | Title 11 |
12 |
15 | 21 | 28 |
29 |
30 | `; 31 | -------------------------------------------------------------------------------- /src/components/__tests__/donate.test.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import toJson from 'enzyme-to-json'; 3 | import { shallow } from 'enzyme'; 4 | import Donate from '../donate'; 5 | 6 | describe('Donate', () => { 7 | it('renders correctly', () => { 8 | const component = shallow(); 9 | expect(toJson(component)).toMatchSnapshot(); 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /src/components/__tests__/footer.test.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { shallow } from 'enzyme'; 3 | import toJson from 'enzyme-to-json'; 4 | 5 | import Footer from '../footer'; 6 | 7 | describe('Footer component', () => { 8 | const component = shallow(