Aktueller Stand

This commit is contained in:
2026-01-22 19:05:45 +01:00
parent 85dee61a4d
commit e280e4eadb
1967 changed files with 397327 additions and 74093 deletions

View File

@@ -1,9 +1,9 @@
'use strict'
const t = require('tap')
const { test } = require('node:test')
const FindMyWay = require('../')
t.test('issue-190', (t) => {
test('issue-190', (t) => {
t.plan(6)
const findMyWay = FindMyWay()
@@ -18,10 +18,10 @@ t.test('issue-190', (t) => {
findMyWay.on('GET', '/api/users/:id', paramPath)
findMyWay.on('GET', '/api/:resourceType/foo', extraPath)
t.equal(findMyWay.find('GET', '/api/users/admins').handler, staticPath)
t.equal(findMyWay.find('GET', '/api/users/award_winners').handler, staticPath)
t.equal(findMyWay.find('GET', '/api/users/a766c023-34ec-40d2-923c-e8259a28d2c5').handler, paramPath)
t.equal(findMyWay.find('GET', '/api/users/b766c023-34ec-40d2-923c-e8259a28d2c5').handler, paramPath)
t.assert.equal(findMyWay.find('GET', '/api/users/admins').handler, staticPath)
t.assert.equal(findMyWay.find('GET', '/api/users/award_winners').handler, staticPath)
t.assert.equal(findMyWay.find('GET', '/api/users/a766c023-34ec-40d2-923c-e8259a28d2c5').handler, paramPath)
t.assert.equal(findMyWay.find('GET', '/api/users/b766c023-34ec-40d2-923c-e8259a28d2c5').handler, paramPath)
findMyWay.lookup({
method: 'GET',
@@ -39,6 +39,6 @@ t.test('issue-190', (t) => {
headers: { }
})
t.equal(staticCounter, 2)
t.equal(paramCounter, 1)
t.assert.equal(staticCounter, 2)
t.assert.equal(paramCounter, 1)
})