This is Sourcegraph's Marketing Site which is a Next.js project bootstrapped with create-next-app
.
First, make sure that you have Node.js installed. You can use nvm
to automatically use the version of Node.js which is specified in the repository's .nvmrc
file:
nvm install
Alternatively, you can use n
to manage your Node versions. Use the following command to install the version of Node specified in the .nvmrc
file:
n <node version>
From the top level of the project, run the following command to install dependencies:
yarn ci
This will install the dependencies while ensuring the lock file remains unmodified.
To run the application, type the following command from the top level of the project:
yarn dev
Open http://localhost:3000 with your browser to see the result.
To enable our pre-commit hook, update the following git config setting in the project:
git config core.hooksPath .githooks
We use Cypress as our test suite and currently have end to end tests configured.
To run tests visually, run:
yarn test
To run tests headlessly in the CLI, run:
yarn test:ci
- To create an e2e test, add them to the e2e directory with a descriptive file name.
- To run tests in development, run
yarn test
which watches your test files as you develop. Cypress will open in a new window. - Click on E2E Testing and choose a preferred browser. Click on "Start E2E Testing in {browser}.
- You will see the tests we have under specs. Click a spec to run the test.
- Alternatively, you can run tests in the command line in headless mode by running
yarn test:ci
.