hono icon indicating copy to clipboard operation
hono copied to clipboard

test: add router/common.case.test.ts

Open usualoma opened this issue 1 year ago • 0 comments

fixes #1953

Tidy up

Suppress errors from yarn lint:fix

  • 2c521b2b771bacbba6b90072b52c7cc0849714fe
  • 57cef10b0dee45a40b75e7fde8a0bd097bd23976

Tweaks vitest.config.ts

Exclude "*.case.test.ts" from vitest

These special files are used to share test cases between different modules or runtime environments.

  • shared among multiple routers
  • shared by renderToString and renderToDom

Since these files are test files, they should be excluded from the build, in which case it is convenient to name them "*.test.ts". However, the file itself does not contain the test execution, so it should be excluded from vitest watch. With that motivation, we added "*.case.test.ts" to the exclude of vitest.

src/router/common.case.test.ts

All routers run tests using runTest exported from this file. For routers other than "TireRouter", there are a few test cases that do not pass (this was intended at the time of implementation), so we need to explicitly specify to skip them and instead add router-specific tests.

Author should do the followings, if applicable

  • [x] Add tests
  • [x] Run tests

usualoma avatar Feb 23 '24 05:02 usualoma