Skip to content
On this page

Clear

  • Method: clear()
  • Return: void
  • Usage:

Clear caches. Use it after the end of each test

ts
import { clear } from '@rpgjs/testing'
import { afterEach } from 'vitest'

afterEach(() => {
     clear()
})

Next Tick

  • Method: nextTick(client,timestamp?)
  • Arguments:
    • { RpgClientEngine} client. (Optional: false)
    • {number} timestamp. A predefined timestamp (Optional: true)
  • Return: Promise
  • Usage:

Allows you to make a tick:

  1. on server
  2. server sends data to client
  3. Client retrieves data and performs inputs (move, etc.) and server reconciliation
  4. A tick is performed on the client
  5. A tick is performed on VueJS

Wait a moment

  • Since: 4.0.0
  • Method: waitUntil(promise)
  • Arguments:
    • {Promise} promise. (Optional: false)
  • Return: Promise
  • Example:
ts
await waitUntil(
 player.moveRoutes([Move.right()])
)
  • Usage: