Aktueller Stand
This commit is contained in:
13
backend/node_modules/find-my-way/test/shorthands.test.js
generated
vendored
13
backend/node_modules/find-my-way/test/shorthands.test.js
generated
vendored
@@ -1,23 +1,20 @@
|
||||
'use strict'
|
||||
|
||||
const httpMethods = require('../lib/http-methods')
|
||||
const t = require('tap')
|
||||
const test = t.test
|
||||
const { describe, test } = require('node:test')
|
||||
const FindMyWay = require('../')
|
||||
|
||||
t.test('should support shorthand', t => {
|
||||
t.plan(httpMethods.length)
|
||||
|
||||
describe('should support shorthand', t => {
|
||||
for (const i in httpMethods) {
|
||||
const m = httpMethods[i]
|
||||
const methodName = m.toLowerCase()
|
||||
|
||||
t.test('`.' + methodName + '`', t => {
|
||||
test('`.' + methodName + '`', t => {
|
||||
t.plan(1)
|
||||
const findMyWay = FindMyWay()
|
||||
|
||||
findMyWay[methodName]('/test', () => {
|
||||
t.ok('inside the handler')
|
||||
t.assert.ok('inside the handler')
|
||||
})
|
||||
|
||||
findMyWay.lookup({ method: m, url: '/test', headers: {} }, null)
|
||||
@@ -30,7 +27,7 @@ test('should support `.all` shorthand', t => {
|
||||
const findMyWay = FindMyWay()
|
||||
|
||||
findMyWay.all('/test', () => {
|
||||
t.ok('inside the handler')
|
||||
t.assert.ok('inside the handler')
|
||||
})
|
||||
|
||||
findMyWay.lookup({ method: 'GET', url: '/test', headers: {} }, null)
|
||||
|
||||
Reference in New Issue
Block a user