12 lines
383 B
JavaScript
12 lines
383 B
JavaScript
import test from 'node:test'
|
|
import assert from 'node:assert/strict'
|
|
import { loadModule } from './load.mjs'
|
|
|
|
const { createRequestGuard } = await loadModule('src/lib/requestGuard.js')
|
|
test('nur die jüngste Anfrage gilt', () => {
|
|
const g = createRequestGuard()
|
|
const a = g.next(); const b = g.next()
|
|
assert.equal(g.isCurrent(a), false)
|
|
assert.equal(g.isCurrent(b), true)
|
|
})
|