Skip to content

Commit

Permalink
chore (#36): add maintenance tooling (#38)
Browse files Browse the repository at this point in the history
* adds cypress, config, and test

* adds netlify cypress plugin and toml config

* adds descriptive title to test

* adds renovate config file

* adds testing docs and toc

* adds cypress, config, and test

* adds netlify cypress plugin and toml config

* adds descriptive title to test

* adds testing docs and toc

* fix: Adds dedicated version to plugin

* fix(deps): update dependency @netlify/plugin-nextjs to 4.9

* fix(deps): update dependency @netlify/plugin-nextjs to 4.10

* fix(deps): update dependency @netlify/plugin-nextjs to 4.11

* chore(deps): update dependency eslint-config-next to v12.2.0

* chore(deps): update dependency eslint-config-next to v12.2.2

* fix(deps): update dependency @netlify/plugin-nextjs to 4.12

* fix(deps): update dependency @netlify/plugin-nextjs to 4.13 (#57)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency eslint-config-next to v12.2.3

* fix(deps): update dependency @netlify/plugin-nextjs to 4.14

* removes lock

Co-authored-by: Prince Wilson <[email protected]>
Co-authored-by: Renovate Bot <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • Loading branch information
4 people authored Aug 5, 2022
1 parent e51d26b commit af72a88
Show file tree
Hide file tree
Showing 7 changed files with 16,851 additions and 208 deletions.
54 changes: 54 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@ A customizable blog starter using:

[Click here to watch the template walkthrough!](https://www.youtube.com/watch?v=63QZHs259dY)

## Table of Contents:

- [Getting Started](#getting-started)
- [Setting Up Locally](#setting-up-locally)
- [Using the Wizard](#using-the-setup-wizard)
- [Configuring the Blog](#configuring-the-blog)
- [Adding New Posts](#adding-new-posts)
- [Testing](#testing)
- [Included Default Testing](#included-default-testing)
- [Removing Renovate](#removing-renovate)
- [Removing Cypress](#removing-cypress)

## Getting Started

---
Expand Down Expand Up @@ -83,3 +95,45 @@ Since the posts are written in `MDX` format you can pass props and components. T
https://user-images.githubusercontent.com/3611928/152727802-102ec296-41c8-446d-93ed-922d11187073.mp4

[alt: video walkthrough of adding a new blog post]

## Testing

### Included Default Testing

We’ve included some tooling that helps us maintain these templates. This template currently uses:

- [Renovate](https://www.mend.io/free-developer-tools/renovate/) - to regularly update our dependencies
- [Cypress](https://www.cypress.io/) - to run tests against how the template runs in the browser
- [Cypress Netlify Build Plugin](https://github.com/cypress-io/netlify-plugin-cypress) - to run our tests during our build process

If your team is not interested in this tooling, you can remove them with ease!

### Removing Renovate

In order to keep our project up-to-date with dependencies we use a tool called [Renovate](https://github.com/marketplace/renovate). If you’re not interested in this tooling, delete the `renovate.json` file and commit that onto your main branch.

### Removing Cypress

For our testing, we use [Cypress](https://www.cypress.io/) for end-to-end testing. This makes sure that we can validate that our templates are rendering and displaying as we’d expect. By default, we have Cypress not generate deploy links if our tests don’t pass. If you’d like to keep Cypress and still generate the deploy links, go into your `netlify.toml` and delete the plugin configuration lines:

```diff
[[plugins]]
package = "netlify-plugin-cypress"
- [plugins.inputs.postBuild]
- enable = true
-
- [plugins.inputs]
- enable = false
```

If you’d like to remove the `netlify-plugin-cypress` build plugin entirely, you’d need to delete the entire block above instead. And then make sure sure to remove the package from the dependencies using:

```bash
npm uninstall -D netlify-plugin-cypress
```

And lastly if you’d like to remove Cypress entirely, delete the entire `cypress` folder and the `cypress.config.ts` file. Then remove the dependency using:

```bash
npm uninstall cypress
```
8 changes: 8 additions & 0 deletions cypress.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const { defineConfig } = require('cypress');

module.exports = defineConfig({
e2e: {
baseUrl: 'http://localhost:3000',
supportFile: false,
},
});
9 changes: 9 additions & 0 deletions cypress/e2e/basic.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
describe('sample render test', () => {
beforeEach(() => {
cy.visit('/');
});

it('displays the title text', () => {
cy.get('h1').contains('Next.js Blog Theme');
});
});
9 changes: 9 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,12 @@

[[plugins]]
package = "@netlify/plugin-nextjs"

[[plugins]]
package = "netlify-plugin-cypress"

[plugins.inputs.postBuild]
enable = true

[plugins.inputs]
enable = false
Loading

0 comments on commit af72a88

Please sign in to comment.