Skip to content

Commit cbf7934

Browse files
authored
Feat/add integration tests (#28)
* feat: add integration tests * chore: test * chore: update * chore: update * chore: update * chore: fix the headers test * chore: cleanup * chore: cleanup
1 parent 2aa508b commit cbf7934

19 files changed

+3444
-318
lines changed

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
dist/
22
demo/
3+
tests/

.eslintrc.cjs

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ module.exports = {
1515
'unicorn/filename-case': ['error', { case: 'kebabCase' }],
1616
'import/no-namespace': 'off',
1717
'import/extensions': 'off',
18+
'max-depth': 'off',
1819
},
1920
overrides: [
2021
...overrides,

.github/workflows/run-tests.yml

+11-9
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@ jobs:
77
runs-on: ubuntu-latest
88

99
steps:
10-
- uses: actions/checkout@v4
11-
- name: 'Install Node'
12-
uses: actions/setup-node@v3
13-
with:
14-
node-version: '18.x'
15-
- name: 'Install dependencies'
16-
run: npm ci
17-
- name: 'Test'
18-
run: npm run test:ci
10+
- uses: actions/checkout@v4
11+
- name: 'Install Node'
12+
uses: actions/setup-node@v3
13+
with:
14+
node-version: '18.x'
15+
- name: 'Install dependencies'
16+
run: npm ci
17+
- name: 'build'
18+
run: npm run build
19+
- name: 'Test'
20+
run: npm run test:ci

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
node_modules/
22
dist/
3+
.next
34

45
# Local Netlify folder
56
.netlify

README.md

+18-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
11
# Next.js Runtime
22

3-
Next.js is supported natively on Netlify, and in most cases you will not need to install or configure anything. This
4-
repo includes the packages used to support Next.js on Netlify.
3+
Next.js is supported natively on Netlify, and in most cases you will not need to install or
4+
configure anything. This repo includes the packages used to support Next.js on Netlify.
5+
6+
## Testing
7+
8+
### Integration testing
9+
10+
How to add new integration test scenarios to the application:
11+
12+
1. Create a new folder under `tests/fixtures/<your-name>`
13+
2. Adapt the `next.config.js` to be a standalone application
14+
3. Create a `postinstall` script that runs the `next build`. It's important to notice that the
15+
integration tests rely on a already built next.js application in this folder. They rely on the
16+
`.next` folder.
17+
4. Add your test
18+
19+
> Currently the tests require a built version of the `dist/handlers/cache.cjs` so you need to run
20+
> `npm run build` before executing the integration tests.

0 commit comments

Comments
 (0)