Skip to content

Commit 4f9bb1d

Browse files
test: move tests to src directory (#1075)
* test(react-renderer): move tests to src directory * test: move tests to src directory * test: ensure vitest-pool-workers is installed at the root
1 parent 5fac2ef commit 4f9bb1d

File tree

38 files changed

+129
-120
lines changed

38 files changed

+129
-120
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
"devDependencies": {
6161
"@changesets/changelog-github": "^0.4.8",
6262
"@changesets/cli": "^2.26.0",
63+
"@cloudflare/vitest-pool-workers": "^0.7.8",
6364
"@cloudflare/workers-types": "^4.20230307.0",
6465
"@ryoppippi/unplugin-typia": "^1.2.0",
6566
"@types/node": "^20.14.8",

packages/ajv-validator/test/index.test.ts renamed to packages/ajv-validator/src/index.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { JSONSchemaType, type ErrorObject } from 'ajv'
22
import { Hono } from 'hono'
33
import type { Equal, Expect } from 'hono/utils/types'
4-
import { ajvValidator } from '../src'
4+
import { ajvValidator } from '.'
55

66
type ExtractSchema<T> = T extends Hono<infer _, infer S> ? S : never
77

@@ -193,7 +193,7 @@ describe('With Hook', () => {
193193
{
194194
keyword: 'required',
195195
instancePath: '',
196-
message: 'must have required property \'title\'',
196+
message: "must have required property 'title'",
197197
},
198198
])
199199
})

packages/auth-js/test/index.test.ts renamed to packages/auth-js/src/index.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import type { Adapter } from '@auth/core/adapters'
33
import Credentials from '@auth/core/providers/credentials'
44
import { Hono } from 'hono'
55
import { describe, expect, it, vi } from 'vitest'
6-
import type { AuthConfig } from '../src'
7-
import { authHandler, verifyAuth, initAuthConfig, reqWithEnvUrl } from '../src'
6+
import type { AuthConfig } from '.'
7+
import { authHandler, verifyAuth, initAuthConfig, reqWithEnvUrl } from '.'
88

99
describe('Config', () => {
1010
it('Should return 500 if AUTH_SECRET is missing', async () => {

packages/casbin/test/index.test.ts renamed to packages/casbin/src/index.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { Hono } from 'hono'
33
import { basicAuth } from 'hono/basic-auth'
44
import { jwt, sign } from 'hono/jwt'
55
import { describe, it, expect } from 'vitest'
6-
import { casbin } from '../src'
7-
import { basicAuthorizer, jwtAuthorizer } from '../src/helper'
6+
import { basicAuthorizer, jwtAuthorizer } from './helper'
7+
import { casbin } from '.'
88

99
describe('Casbin Middleware Tests', () => {
1010
describe('BasicAuthorizer', () => {

packages/class-validator/test/index.test.ts renamed to packages/class-validator/src/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { IsInt, IsString, ValidateNested } from 'class-validator'
44
import { Hono } from 'hono'
55
import type { ExtractSchema } from 'hono/types'
66
import type { Equal, Expect } from 'hono/utils/types'
7-
import { classValidator } from '../src'
7+
import { classValidator } from '.'
88

99
describe('Basic', () => {
1010
const app = new Hono()

packages/cloudflare-access/src/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { describe, expect, it, vi } from 'vitest'
33

44
import crypto from 'crypto'
55
import { promisify } from 'util'
6-
import { cloudflareAccess } from '../src'
6+
import { cloudflareAccess } from '.'
77

88
const generateKeyPair = promisify(crypto.generateKeyPair)
99

packages/conform-validator/test/common.test.ts renamed to packages/conform-validator/src/common.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { parseWithZod } from '@conform-to/zod'
22
import { Hono } from 'hono'
33
import { z } from 'zod'
4-
import { conformValidator } from '../src'
4+
import { conformValidator } from '.'
55

66
describe('Validate common processing', () => {
77
const app = new Hono()

packages/conform-validator/test/hook.test.ts renamed to packages/conform-validator/src/hook.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Hono } from 'hono'
33
import { hc } from 'hono/client'
44
import { vi } from 'vitest'
55
import * as z from 'zod'
6-
import { conformValidator } from '../src'
6+
import { conformValidator } from '.'
77

88
describe('Validate the hook option processing', () => {
99
const app = new Hono()

packages/conform-validator/test/valibot.test.ts renamed to packages/conform-validator/src/valibot.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type { ExtractSchema, ParsedFormValue } from 'hono/types'
55
import type { StatusCode } from 'hono/utils/http-status'
66
import type { Equal, Expect } from 'hono/utils/types'
77
import * as v from 'valibot'
8-
import { conformValidator } from '../src'
8+
import { conformValidator } from '.'
99

1010
describe('Validate requests using a Valibot schema', () => {
1111
const app = new Hono()

packages/conform-validator/test/yup.test.ts renamed to packages/conform-validator/src/yup.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type { ExtractSchema, ParsedFormValue } from 'hono/types'
55
import type { StatusCode } from 'hono/utils/http-status'
66
import type { Equal, Expect } from 'hono/utils/types'
77
import * as y from 'yup'
8-
import { conformValidator } from '../src'
8+
import { conformValidator } from '.'
99

1010
describe('Validate requests using a Yup schema', () => {
1111
const app = new Hono()

0 commit comments

Comments
 (0)