mirror of
https://github.com/honojs/hono.git
synced 2024-11-21 18:18:57 +01:00
chore: rename runtime_tests
to runtime-tests
(#3419)
* chore: rename `runtime_tests` to `runtime-tests` * fixed GitHub workflow
This commit is contained in:
parent
b5c6285b84
commit
dfbd717263
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
@ -77,9 +77,9 @@ jobs:
|
||||
- uses: denoland/setup-deno@v1
|
||||
with:
|
||||
deno-version: v1.x
|
||||
- run: env NAME=Deno deno test --coverage=coverage/raw/deno-runtime --allow-read --allow-env --allow-write --allow-net -c runtime_tests/deno/deno.json runtime_tests/deno
|
||||
- run: deno test -c runtime_tests/deno-jsx/deno.precompile.json --coverage=coverage/raw/deno-precompile-jsx runtime_tests/deno-jsx
|
||||
- run: deno test -c runtime_tests/deno-jsx/deno.react-jsx.json --coverage=coverage/raw/deno-react-jsx runtime_tests/deno-jsx
|
||||
- run: env NAME=Deno deno test --coverage=coverage/raw/deno-runtime --allow-read --allow-env --allow-write --allow-net -c runtime-tests/deno/deno.json runtime-tests/deno
|
||||
- run: deno test -c runtime-tests/deno-jsx/deno.precompile.json --coverage=coverage/raw/deno-precompile-jsx runtime-tests/deno-jsx
|
||||
- run: deno test -c runtime-tests/deno-jsx/deno.react-jsx.json --coverage=coverage/raw/deno-react-jsx runtime-tests/deno-jsx
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: coverage-deno
|
||||
|
24
package.json
24
package.json
@ -12,18 +12,18 @@
|
||||
"scripts": {
|
||||
"test": "tsc --noEmit && vitest --run && vitest -c .vitest.config/jsx-runtime-default.ts --run && vitest -c .vitest.config/jsx-runtime-dom.ts --run",
|
||||
"test:watch": "vitest --watch",
|
||||
"test:deno": "deno test --allow-read --allow-env --allow-write --allow-net -c runtime_tests/deno/deno.json runtime_tests/deno && deno test --no-lock -c runtime_tests/deno-jsx/deno.precompile.json runtime_tests/deno-jsx && deno test --no-lock -c runtime_tests/deno-jsx/deno.react-jsx.json runtime_tests/deno-jsx",
|
||||
"test:bun": "bun test --jsx-import-source ../../src/jsx runtime_tests/bun/index.test.tsx",
|
||||
"test:fastly": "vitest --run --config ./runtime_tests/fastly/vitest.config.ts",
|
||||
"test:node": "vitest --run --config ./runtime_tests/node/vitest.config.ts",
|
||||
"test:workerd": "vitest --run --config ./runtime_tests/workerd/vitest.config.ts",
|
||||
"test:lambda": "vitest --run --config ./runtime_tests/lambda/vitest.config.ts",
|
||||
"test:lambda-edge": "vitest --run --config ./runtime_tests/lambda-edge/vitest.config.ts",
|
||||
"test:deno": "deno test --allow-read --allow-env --allow-write --allow-net -c runtime-tests/deno/deno.json runtime-tests/deno && deno test --no-lock -c runtime-tests/deno-jsx/deno.precompile.json runtime-tests/deno-jsx && deno test --no-lock -c runtime-tests/deno-jsx/deno.react-jsx.json runtime-tests/deno-jsx",
|
||||
"test:bun": "bun test --jsx-import-source ../../src/jsx runtime-tests/bun/index.test.tsx",
|
||||
"test:fastly": "vitest --run --config ./runtime-tests/fastly/vitest.config.ts",
|
||||
"test:node": "vitest --run --config ./runtime-tests/node/vitest.config.ts",
|
||||
"test:workerd": "vitest --run --config ./runtime-tests/workerd/vitest.config.ts",
|
||||
"test:lambda": "vitest --run --config ./runtime-tests/lambda/vitest.config.ts",
|
||||
"test:lambda-edge": "vitest --run --config ./runtime-tests/lambda-edge/vitest.config.ts",
|
||||
"test:all": "bun run test && bun test:deno && bun test:bun && bun test:fastly && bun test:node && bun test:workerd && bun test:lambda && bun test:lambda-edge",
|
||||
"lint": "eslint src runtime_tests",
|
||||
"lint:fix": "eslint src runtime_tests --fix",
|
||||
"format": "prettier --check --cache \"src/**/*.{js,ts,tsx}\" \"runtime_tests/**/*.{js,ts,tsx}\"",
|
||||
"format:fix": "prettier --write --cache --cache-strategy metadata \"src/**/*.{js,ts,tsx}\" \"runtime_tests/**/*.{js,ts,tsx}\"",
|
||||
"lint": "eslint src runtime-tests",
|
||||
"lint:fix": "eslint src runtime-tests --fix",
|
||||
"format": "prettier --check --cache \"src/**/*.{js,ts,tsx}\" \"runtime-tests/**/*.{js,ts,tsx}\"",
|
||||
"format:fix": "prettier --write --cache --cache-strategy metadata \"src/**/*.{js,ts,tsx}\" \"runtime-tests/**/*.{js,ts,tsx}\"",
|
||||
"copy:package.cjs.json": "cp ./package.cjs.json ./dist/cjs/package.json && cp ./package.cjs.json ./dist/types/package.json ",
|
||||
"build": "bun run --shell bun remove-dist && bun ./build.ts && bun run copy:package.cjs.json",
|
||||
"postbuild": "publint",
|
||||
@ -647,4 +647,4 @@
|
||||
"engines": {
|
||||
"node": ">=16.9.0"
|
||||
}
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
@ -83,10 +83,10 @@ describe('Basic Auth Middleware', () => {
|
||||
describe('Serve Static Middleware', () => {
|
||||
const app = new Hono()
|
||||
const onNotFound = vi.fn(() => {})
|
||||
app.all('/favicon.ico', serveStatic({ path: './runtime_tests/bun/favicon.ico' }))
|
||||
app.all('/favicon.ico', serveStatic({ path: './runtime-tests/bun/favicon.ico' }))
|
||||
app.all(
|
||||
'/favicon-notfound.ico',
|
||||
serveStatic({ path: './runtime_tests/bun/favicon-notfound.ico', onNotFound })
|
||||
serveStatic({ path: './runtime-tests/bun/favicon-notfound.ico', onNotFound })
|
||||
)
|
||||
app.use('/favicon-notfound.ico', async (c, next) => {
|
||||
await next()
|
||||
@ -95,14 +95,14 @@ describe('Serve Static Middleware', () => {
|
||||
app.get(
|
||||
'/static/*',
|
||||
serveStatic({
|
||||
root: './runtime_tests/bun/',
|
||||
root: './runtime-tests/bun/',
|
||||
onNotFound,
|
||||
})
|
||||
)
|
||||
app.get(
|
||||
'/dot-static/*',
|
||||
serveStatic({
|
||||
root: './runtime_tests/bun/',
|
||||
root: './runtime-tests/bun/',
|
||||
rewriteRequestPath: (path) => path.replace(/^\/dot-static/, './.static'),
|
||||
})
|
||||
)
|
||||
@ -121,7 +121,7 @@ describe('Serve Static Middleware', () => {
|
||||
expect(res.status).toBe(404)
|
||||
expect(res.headers.get('X-Custom')).toBe('Bun')
|
||||
expect(onNotFound).toHaveBeenCalledWith(
|
||||
'./runtime_tests/bun/favicon-notfound.ico',
|
||||
'./runtime-tests/bun/favicon-notfound.ico',
|
||||
expect.anything()
|
||||
)
|
||||
})
|
@ -5,7 +5,7 @@ import config from '../../vitest.config'
|
||||
export default defineConfig({
|
||||
test: {
|
||||
globals: true,
|
||||
include: ['**/runtime_tests/bun/**/*.+(ts|tsx|js)'],
|
||||
include: ['**/runtime-tests/bun/**/*.+(ts|tsx|js)'],
|
||||
coverage: {
|
||||
...config.test?.coverage,
|
||||
reportsDirectory: './coverage/raw/runtime-bun',
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
@ -68,10 +68,10 @@ Deno.test('JSX middleware', async () => {
|
||||
Deno.test('Serve Static middleware', async () => {
|
||||
const app = new Hono()
|
||||
const onNotFound = spy(() => {})
|
||||
app.all('/favicon.ico', serveStatic({ path: './runtime_tests/deno/favicon.ico' }))
|
||||
app.all('/favicon.ico', serveStatic({ path: './runtime-tests/deno/favicon.ico' }))
|
||||
app.all(
|
||||
'/favicon-notfound.ico',
|
||||
serveStatic({ path: './runtime_tests/deno/favicon-notfound.ico', onNotFound })
|
||||
serveStatic({ path: './runtime-tests/deno/favicon-notfound.ico', onNotFound })
|
||||
)
|
||||
app.use('/favicon-notfound.ico', async (c, next) => {
|
||||
await next()
|
||||
@ -81,7 +81,7 @@ Deno.test('Serve Static middleware', async () => {
|
||||
app.get(
|
||||
'/static/*',
|
||||
serveStatic({
|
||||
root: './runtime_tests/deno',
|
||||
root: './runtime-tests/deno',
|
||||
onNotFound,
|
||||
})
|
||||
)
|
||||
@ -89,7 +89,7 @@ Deno.test('Serve Static middleware', async () => {
|
||||
app.get(
|
||||
'/dot-static/*',
|
||||
serveStatic({
|
||||
root: './runtime_tests/deno',
|
||||
root: './runtime-tests/deno',
|
||||
rewriteRequestPath: (path) => path.replace(/^\/dot-static/, './.static'),
|
||||
})
|
||||
)
|
@ -7,8 +7,8 @@ export default defineConfig({
|
||||
plugins: [fastlyCompute()],
|
||||
test: {
|
||||
globals: true,
|
||||
include: ['**/runtime_tests/fastly/**/(*.)+(test).+(ts|tsx)'],
|
||||
exclude: ['**/runtime_tests/fastly/vitest.config.ts'],
|
||||
include: ['**/runtime-tests/fastly/**/(*.)+(test).+(ts|tsx)'],
|
||||
exclude: ['**/runtime-tests/fastly/vitest.config.ts'],
|
||||
coverage: {
|
||||
...config.test?.coverage,
|
||||
reportsDirectory: './coverage/raw/runtime-fastly',
|
@ -8,8 +8,8 @@ export default defineConfig({
|
||||
NAME: 'Node',
|
||||
},
|
||||
globals: true,
|
||||
include: ['**/runtime_tests/lambda-edge/**/*.+(ts|tsx|js)'],
|
||||
exclude: ['**/runtime_tests/lambda-edge/vitest.config.ts'],
|
||||
include: ['**/runtime-tests/lambda-edge/**/*.+(ts|tsx|js)'],
|
||||
exclude: ['**/runtime-tests/lambda-edge/vitest.config.ts'],
|
||||
coverage: {
|
||||
...config.test?.coverage,
|
||||
reportsDirectory: './coverage/raw/runtime-lambda-edge',
|
@ -8,11 +8,11 @@ export default defineConfig({
|
||||
NAME: 'Node',
|
||||
},
|
||||
globals: true,
|
||||
include: ['**/runtime_tests/lambda/**/*.+(ts|tsx|js)'],
|
||||
include: ['**/runtime-tests/lambda/**/*.+(ts|tsx|js)'],
|
||||
exclude: [
|
||||
'**/runtime_tests/lambda/vitest.config.ts',
|
||||
'**/runtime_tests/lambda/mock.ts',
|
||||
'**/runtime_tests/lambda/stream-mock.ts',
|
||||
'**/runtime-tests/lambda/vitest.config.ts',
|
||||
'**/runtime-tests/lambda/mock.ts',
|
||||
'**/runtime-tests/lambda/stream-mock.ts',
|
||||
],
|
||||
coverage: {
|
||||
...config.test?.coverage,
|
@ -8,8 +8,8 @@ export default defineConfig({
|
||||
NAME: 'Node',
|
||||
},
|
||||
globals: true,
|
||||
include: ['**/runtime_tests/node/**/*.+(ts|tsx|js)'],
|
||||
exclude: ['**/runtime_tests/node/vitest.config.ts'],
|
||||
include: ['**/runtime-tests/node/**/*.+(ts|tsx|js)'],
|
||||
exclude: ['**/runtime-tests/node/vitest.config.ts'],
|
||||
coverage: {
|
||||
...config.test?.coverage,
|
||||
reportsDirectory: './coverage/raw/runtime-node',
|
@ -6,7 +6,7 @@ describe('workerd', () => {
|
||||
let worker: UnstableDevWorker
|
||||
|
||||
beforeAll(async () => {
|
||||
worker = await unstable_dev('./runtime_tests/workerd/index.ts', {
|
||||
worker = await unstable_dev('./runtime-tests/workerd/index.ts', {
|
||||
vars: {
|
||||
NAME: 'Hono',
|
||||
},
|
||||
@ -35,7 +35,7 @@ describe('workerd with WebSocket', () => {
|
||||
// worker.fetch does not support WebSocket:
|
||||
// https://github.com/cloudflare/workers-sdk/issues/4573#issuecomment-1850420973
|
||||
it('Should handle the WebSocket connection correctly', async () => {
|
||||
const worker = await unstable_dev('./runtime_tests/workerd/index.ts', {
|
||||
const worker = await unstable_dev('./runtime-tests/workerd/index.ts', {
|
||||
experimental: { disableExperimentalWarning: true },
|
||||
})
|
||||
const ws = new WebSocket(`ws://${worker.address}:${worker.port}/ws`)
|
@ -5,8 +5,8 @@ import config from '../../vitest.config'
|
||||
export default defineConfig({
|
||||
test: {
|
||||
globals: true,
|
||||
include: ['**/runtime_tests/workerd/**/(*.)+(test).+(ts|tsx)'],
|
||||
exclude: ['**/runtime_tests/workerd/vitest.config.ts'],
|
||||
include: ['**/runtime-tests/workerd/**/(*.)+(test).+(ts|tsx)'],
|
||||
exclude: ['**/runtime-tests/workerd/vitest.config.ts'],
|
||||
coverage: {
|
||||
...config.test?.coverage,
|
||||
reportsDirectory: './coverage/raw/runtime-workerd',
|
@ -19,7 +19,7 @@ export default defineConfig({
|
||||
exclude: [
|
||||
...(configDefaults.coverage.exclude ?? []),
|
||||
'benchmarks',
|
||||
'runtime_tests',
|
||||
'runtime-tests',
|
||||
'build.ts',
|
||||
'src/test-utils',
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user