Skip to content

Commit

Permalink
chore: rename runtime_tests to runtime-tests (#3419)
Browse files Browse the repository at this point in the history
* chore: rename `runtime_tests` to `runtime-tests`

* fixed GitHub workflow
  • Loading branch information
yusukebe authored Sep 17, 2024
1 parent b5c6285 commit dfbd717
Show file tree
Hide file tree
Showing 42 changed files with 40 additions and 40 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -647,4 +647,4 @@
"engines": {
"node": ">=16.9.0"
}
}
}
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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'),
})
)
Expand All @@ -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()
)
})
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -81,15 +81,15 @@ Deno.test('Serve Static middleware', async () => {
app.get(
'/static/*',
serveStatic({
root: './runtime_tests/deno',
root: './runtime-tests/deno',
onNotFound,
})
)

app.get(
'/dot-static/*',
serveStatic({
root: './runtime_tests/deno',
root: './runtime-tests/deno',
rewriteRequestPath: (path) => path.replace(/^\/dot-static/, './.static'),
})
)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
Expand Down Expand Up @@ -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`)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default defineConfig({
exclude: [
...(configDefaults.coverage.exclude ?? []),
'benchmarks',
'runtime_tests',
'runtime-tests',
'build.ts',
'src/test-utils',

Expand Down

0 comments on commit dfbd717

Please sign in to comment.