Skip to content

Commit 45b64db

Browse files
committed
Upgrade lint and move test tsconfig to proper spot
1 parent 9e54557 commit 45b64db

15 files changed

+128
-106
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module.exports = {
22
parser: '@typescript-eslint/parser',
33
parserOptions: {
44
tsconfigRootDir: __dirname,
5-
project: ['./packages/fastify-renderer/tsconfig.eslint.json', './packages/test-apps/tsconfig.json'],
5+
project: ['./packages/fastify-renderer/tsconfig.eslint.json', './packages/test-apps/simple-react/tsconfig.json'],
66
},
77
settings: {
88
react: {

packages/fastify-renderer/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
"@swc/jest": "^0.2.29",
8282
"@types/connect": "^3.4.35",
8383
"@types/jest": "^26.0.24",
84-
"@types/node": "^14.17.20",
84+
"@types/node": "^18.11.9",
8585
"@types/react": "^17.0.43",
8686
"@types/react-dom": "^17.0.11",
8787
"@types/sanitize-filename": "^1.6.3",
@@ -91,13 +91,12 @@
9191
"fastify": "^3.29.0",
9292
"gitpkg": "^1.0.0-beta.2",
9393
"jest": "^28.1.3",
94-
"jest-playwright-preset": "^2.0.0",
9594
"npm-run-all": "^4.1.5",
9695
"pino-pretty": "^4.8.0",
9796
"react": "0.0.0-experimental-4ead6b530",
9897
"react-dom": "0.0.0-experimental-4ead6b530",
9998
"rimraf": "^3.0.2",
100-
"typescript": "^4.7.4"
99+
"typescript": "^5.2.2"
101100
},
102101
"files": [
103102
"client",

packages/test-apps/simple-react/NavigationHistoryTest.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react'
22
import { Link, useLocation } from 'fastify-renderer/client/react'
33

44
const NavigationHistoryTest = () => {
5-
const [path, navigate] = useLocation()
5+
const [_path, navigate] = useLocation()
66

77
return (
88
<>

packages/test-apps/helpers.ts renamed to packages/test-apps/simple-react/helpers.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,14 @@ export const port = 3000 + parseInt(process.env.JEST_WORKER_ID!) - 1
2020
export const rootURL = `http://localhost:${port}`
2121

2222
beforeAll(async () => {
23-
const testPath = expect.getState().testPath as string
23+
const testPath = expect.getState().testPath
2424
// eslint-disable-next-line @typescript-eslint/prefer-regexp-exec
2525
const testName = slash(testPath).match(/test-apps\/([\w-]+)\//)?.[1]
2626

2727
// if this is a test placed under test-apps/xxx/test/
2828
// start a fastify server in that directory.
2929
if (testName) {
30-
const testAppsRoot = resolve(__dirname, './')
31-
const srcDir = resolve(testAppsRoot, testName)
32-
33-
const serverEntrypoint = resolve(srcDir, 'server.ts')
30+
const serverEntrypoint = resolve(__dirname, 'server.ts')
3431
if (!fs.existsSync(serverEntrypoint)) {
3532
throw Error(`Missing server entrypoint file at: ${serverEntrypoint}`)
3633
}

packages/test-apps/simple-react/package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@
2020
"@playwright/test": "^1.39.0",
2121
"@swc/core": "^1.3.95",
2222
"@swc/jest": "^0.2.29",
23-
"html-validator": "^5.1.18"
23+
"@types/jest": "^26.0.24",
24+
"@types/node": "^18.11.9",
25+
"@types/react": "^17.0.43",
26+
"@types/react-dom": "^17.0.11",
27+
"html-validator": "^5.1.18",
28+
"jest-playwright-preset": "^2.0.0",
29+
"typescript": "^5.2.2"
2430
}
2531
}

packages/test-apps/simple-react/test/boot-props.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { expect } from '@playwright/test'
22
import { Page } from 'playwright-chromium'
3-
import { newTestPage, reactReady, rootURL } from '../../helpers'
3+
import { newTestPage, reactReady, rootURL } from '../helpers'
44

55
describe('boot props', () => {
66
let page: Page

packages/test-apps/simple-react/test/imperative-rendering.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Page } from 'playwright-chromium'
2-
import { newTestPage, reactReady, rootURL } from '../../helpers'
2+
import { newTestPage, reactReady, rootURL } from '../helpers'
33

44
describe('imperative rendering', () => {
55
let page: Page

packages/test-apps/simple-react/test/navigation-details.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Page } from 'playwright-chromium'
2-
import { newTestPage, reactReady, rootURL } from '../../helpers'
2+
import { newTestPage, reactReady, rootURL } from '../helpers'
33

44
describe('navigation details', () => {
55
let page: Page

packages/test-apps/simple-react/test/navigation-history.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Page } from 'playwright-chromium'
2-
import { newTestPage, reactReady, rootURL } from '../../helpers'
2+
import { newTestPage, reactReady, rootURL } from '../helpers'
33

44
describe('navigation details', () => {
55
let page: Page

packages/test-apps/simple-react/test/serve.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import validator from 'html-validator'
22
import { Page } from 'playwright-chromium'
3-
import { newTestPage, reactReady, rootURL } from '../../helpers'
3+
import { newTestPage, reactReady, rootURL } from '../helpers'
44

55
describe('simple-react', () => {
66
let page: Page

0 commit comments

Comments
 (0)