From 9ba9da0402e56d1a26931f32ec9332842957cfd8 Mon Sep 17 00:00:00 2001 From: Marc Littlemore Date: Fri, 16 Dec 2022 10:44:21 +0000 Subject: [PATCH 1/3] docs: add test documentation --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index 52284fb088..d48fe163bd 100644 --- a/README.md +++ b/README.md @@ -156,6 +156,29 @@ The simplest way to do this is to create a `.npmrc` file in the root of your pro public-hoist-pattern[]=* ``` +## Running the tests + +To run the tests, ensure that the dependencies are installed as follows: + +```shell +npm install +``` + +Then run the tests: + +```shell +npm test +``` + +In order to run the end-to-end (E2E) tests, you'll need to set an environment variable `NETLIFY_AUTH_TOKEN` to a valid Netlify personal access token. This can be obtained from the [Netlify UI](https://docs.netlify.com/cli/get-started/#obtain-a-token-in-the-netlify-ui). + +Then run the E2E tests: + +```shell +NETLIFY_AUTH_TOKEN=your-token-here npm test:next +``` + + ## Feedback If you think you have found a bug in Next.js on Netlify, From dc5f3d20c9bd7faae5e79e2ef7edad2a300fe10e Mon Sep 17 00:00:00 2001 From: Marc Littlemore Date: Tue, 31 Jan 2023 10:36:02 +0000 Subject: [PATCH 2/3] docs: update with PR changes --- README.md | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d48fe163bd..bc8c7d6a22 100644 --- a/README.md +++ b/README.md @@ -170,15 +170,29 @@ Then run the tests: npm test ``` -In order to run the end-to-end (E2E) tests, you'll need to set an environment variable `NETLIFY_AUTH_TOKEN` to a valid Netlify personal access token. This can be obtained from the [Netlify UI](https://docs.netlify.com/cli/get-started/#obtain-a-token-in-the-netlify-ui). +### End-to-end tests -Then run the E2E tests: +In order to run the end-to-end (E2E) tests, you'll need to be logged in to Netlify. You can do this using the [Netlify CLI](https://github.com/netlify/cli) with the command: ```shell -NETLIFY_AUTH_TOKEN=your-token-here npm test:next +netlify login ``` +Alternatively, you can set an environment variable `NETLIFY_AUTH_TOKEN` to a valid Netlify personal access token. This can be obtained from the [Netlify UI](https://docs.netlify.com/cli/get-started/#obtain-a-token-in-the-netlify-ui). +Then run the E2E tests if logged in: + +```shell +npm run test:next +``` + +Or if using an access token: + +```shell +NETLIFY_AUTH_TOKEN=your-token-here npm run test:next +``` + +_Note: The E2E tests will be deployed to a Netlify owned site. To deploy to your own site then set the environment variable `NETLIFY_SITE_ID` to your site ID._ ## Feedback If you think you have found a bug in Next.js on Netlify, From b7dbd765343f1d4e423997d362cf06803d49fe9c Mon Sep 17 00:00:00 2001 From: Marc Littlemore Date: Tue, 31 Jan 2023 10:37:20 +0000 Subject: [PATCH 3/3] fix: add missing newline --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index bc8c7d6a22..92ca6ee44c 100644 --- a/README.md +++ b/README.md @@ -193,6 +193,7 @@ NETLIFY_AUTH_TOKEN=your-token-here npm run test:next ``` _Note: The E2E tests will be deployed to a Netlify owned site. To deploy to your own site then set the environment variable `NETLIFY_SITE_ID` to your site ID._ + ## Feedback If you think you have found a bug in Next.js on Netlify,