Skip to content

Commit 72be87d

Browse files
authored
Merge branch 'main' into rs/transform-named-capture-groups
2 parents aba469c + 1bfabc3 commit 72be87d

File tree

605 files changed

+18156
-2883
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

605 files changed

+18156
-2883
lines changed

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ module.exports = {
2929
'unicorn/filename-case': 0,
3030
'unicorn/no-array-push-push': 0,
3131
'unicorn/numeric-separators-style': 0,
32+
'max-lines': 0,
3233
},
3334
parserOptions: {
3435
sourceType: 'module',

.github/workflows/cypress-canary.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Run e2e (canary demo)
22
on:
33
pull_request:
4-
types: [opened, labeled, unlabeled, synchronize]
4+
types: [opened, synchronize]
55
push:
66
branches:
77
- main

.github/workflows/cypress-demo-nx.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Run e2e (Nx monorepo)
22
on:
33
pull_request:
4-
types: [opened, labeled, unlabeled, synchronize]
4+
types: [opened, synchronize]
55
push:
66
branches:
77
- main

.github/workflows/cypress-demo-static.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Run e2e (static root)
22
on:
33
pull_request:
4-
types: [opened, labeled, unlabeled, synchronize]
4+
types: [opened, synchronize]
55
push:
66
branches:
77
- main

.github/workflows/cypress-demo.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Run e2e (default demo)
22
on:
33
pull_request:
4-
types: [opened, labeled, unlabeled, synchronize]
4+
types: [opened, synchronize]
55
push:
66
branches:
77
- main

.github/workflows/cypress-middleware.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Run e2e (middleware demo)
22
on:
33
pull_request:
4-
types: [opened, labeled, unlabeled, synchronize]
4+
types: [opened, synchronize]
55
push:
66
branches:
77
- main

.github/workflows/e2e-appdir.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Next.js appdir test suite
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize]
6+
push:
7+
branches: [main]
8+
9+
jobs:
10+
setup:
11+
runs-on: ubuntu-latest
12+
outputs:
13+
test-files: ${{ steps['set-test-files'].outputs['test-files'] }}
14+
steps:
15+
- uses: actions/checkout@v3
16+
- run: npm install
17+
- id: set-test-files
18+
name: Get test files
19+
# Extracts the list of all test files as JSON and trims to be relative to the test dir to be easier to read
20+
run:
21+
echo "test-files=$(npx jest -c test/e2e/jest.config.appdir.js --listTests --json | jq -cM 'map(.[env.PWD |
22+
length + 10:])')" >> $GITHUB_OUTPUT
23+
# echo "test-files=$(npx jest -c test/e2e/jest.config.all.js --listTests --json | jq -cM 'map(.[env.PWD | length
24+
# + 10:])')" >> $GITHUB_OUTPUT
25+
26+
test:
27+
runs-on: ubuntu-latest
28+
name: test (${{ matrix.test-file }})
29+
needs:
30+
- setup
31+
strategy:
32+
fail-fast: false
33+
matrix:
34+
# Creates a job for each chunk ID. This will be assigned one or more test files to run
35+
test-file: ${{ fromJson(needs.setup.outputs['test-files']) }}
36+
steps:
37+
- uses: actions/checkout@v3
38+
- run: npm install
39+
- name: Run tests
40+
run: npx jest --reporters=jest-junit --reporters=default -c test/e2e/jest.config.all.js ${{ matrix.test-file }}
41+
env:
42+
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_BOT_AUTH_TOKEN }}
43+
NETLIFY_SITE_ID: 1d5a5c76-d445-4ae5-b694-b0d3f2e2c395
44+
NEXT_TEST_VERSION: canary
45+
- uses: actions/upload-artifact@v3
46+
if: ${{ always() }}
47+
name: Upload test results
48+
with:
49+
name: test-results
50+
path: reports/jest-*.xml
51+
report:
52+
name: Report appDir e2e test results
53+
runs-on: ubuntu-latest
54+
if: ${{ always() }}
55+
needs:
56+
- test
57+
steps:
58+
- uses: actions/checkout@v3
59+
- uses: actions/download-artifact@v3
60+
with:
61+
path: reports
62+
- name: Combine reports
63+
# The test reporter can handle multiple files, but these have random filenames so the output is better when combined
64+
run: npx junit-report-merger test-results.xml reports/**/*.xml
65+
- uses: phoenix-actions/test-reporting@v10
66+
with:
67+
name: Jest Tests
68+
output-to: 'step-summary'
69+
path: 'test-results.xml'
70+
max-annotations: 49
71+
reporter: jest-junit

.github/workflows/e2e-next.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: Next.js e2e test suite
22

33
on:
44
pull_request:
5+
types: [opened, synchronize]
56
push:
67
branches: [main]
78

@@ -41,17 +42,6 @@ jobs:
4142
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_BOT_AUTH_TOKEN }}
4243
NETLIFY_SITE_ID: 1d5a5c76-d445-4ae5-b694-b0d3f2e2c395
4344
# RUN_SKIPPED_TESTS: true
44-
# - uses: phoenix-actions/test-reporting@v10
45-
# if: ${{ always() }}
46-
# name: Report Test Results
47-
# # Generates annotations for the test failures
48-
# id: test-report
49-
# with:
50-
# name: E2E Test chunk ${{ matrix.chunk }}
51-
# path: 'reports/**/*.xml' # Path to test results (inside artifact .zip)
52-
# output-to: 'checks'
53-
# max-annotations: 49 # Maximum number of annotations to be created
54-
# reporter: jest-junit # Format of test results
5545

5646
- uses: actions/upload-artifact@v3
5747
# upload test results
@@ -61,6 +51,7 @@ jobs:
6151
name: test-results
6252
path: reports/jest-*.xml
6353
report:
54+
name: Report Next.js e2e test results
6455
runs-on: ubuntu-latest
6556
if: ${{ always() }}
6657
needs:

cypress/integration/default/dynamic-routes.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ describe('Dynamic Routing', () => {
4949
cy.request({ url: '/getStaticProps/3/', headers: { 'x-nf-debug-logging': '1' }, failOnStatusCode: false }).then(
5050
(res) => {
5151
expect(res.status).to.eq(404)
52-
expect(res.headers).to.have.property('x-nf-render-mode', 'odb')
52+
expect(res.headers).to.not.have.property('x-nf-render-mode')
5353
expect(res.body).to.contain('Custom 404')
5454
},
5555
)
@@ -102,7 +102,7 @@ describe('Dynamic Routing', () => {
102102
failOnStatusCode: false,
103103
}).then((res) => {
104104
expect(res.status).to.eq(404)
105-
expect(res.headers).to.have.property('x-nf-render-mode', 'odb')
105+
expect(res.headers).to.not.have.property('x-nf-render-mode')
106106
expect(res.body).to.contain('Custom 404')
107107
})
108108
})

cypress/integration/nx/general.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ describe('Default site', () => {
1010
cy.url().should('eq', `${Cypress.config().baseUrl}/`)
1111
})
1212

13-
it('serves generated public files', async () => {
14-
cy.request('service-worker.js').then((res) => {
13+
it('serves generated public files', () => {
14+
cy.request('favicon.ico').then((res) => {
1515
expect(res.status).to.eq(200)
16-
expect(res.headers['content-type']).to.match(/javascript/)
16+
expect(res.headers['content-type']).to.match(/image/)
1717
})
1818
})
1919

demos/base-path/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"typescript": "^4.6.3"
1515
},
1616
"dependencies": {
17-
"next": "^13.0.3"
17+
"next": "^13.0.6"
1818
},
1919
"scripts": {
2020
"test": "echo \"Error: no test specified\" && exit 1"

0 commit comments

Comments
 (0)