Skip to content

Commit

Permalink
ci: 55
Browse files Browse the repository at this point in the history
  • Loading branch information
waitingsong committed Jan 24, 2025
1 parent 245de52 commit ebdc73a
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 27 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import assert from 'node:assert/strict'

import { fileShortPath } from '@waiting/shared-core'

import { apiBase, apiMethod } from '#@/api-test.js'
import { testConfig } from '#@/root.config.js'


describe(fileShortPath(import.meta.url), function () {
describe('Should @Cacheable decorator work', () => {
const prefix = apiBase.class_cacheable

it(apiMethod.simple, async () => {
const { httpRequest } = testConfig
const url = `${prefix}/${apiMethod.simple}`

const resp = await httpRequest.get(url)
assert(resp.ok, resp.text)
})

it(apiMethod.method_override_class, async () => {
const { httpRequest } = testConfig
const url = `${prefix}/${apiMethod.method_override_class}`

const resp = await httpRequest.get(url)
assert(resp.ok, resp.text)
})


it(apiMethod.ttlFn, async () => {
const { httpRequest } = testConfig
const url = `${prefix}/${apiMethod.ttlFn}`

const resp = await httpRequest.get(url)
assert(resp.ok, resp.text)
})

it(apiMethod.ttl_fn2, async () => {
const { httpRequest } = testConfig
const url = `${prefix}/${apiMethod.ttl_fn2}`

const resp = await httpRequest.get(url)
assert(resp.ok, resp.text)
})
})
})

26 changes: 0 additions & 26 deletions packages/cache/test/cacheput/40.simple.test.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export class ClassDecoratorController {
validateMeta(ret3a, `${cacheKey}:foo`, ttl)
console.log(2012)

await sleep(ttl * 1001)
await sleep(ttl * 1002)

const ret4 = await this.svc.ttlFn('foo')
console.log(2013)
Expand Down

0 comments on commit ebdc73a

Please sign in to comment.