Aktueller Stand
This commit is contained in:
11
backend/node_modules/find-my-way/test/issue-221.test.js
generated
vendored
11
backend/node_modules/find-my-way/test/issue-221.test.js
generated
vendored
@@ -1,7 +1,6 @@
|
||||
'use strict'
|
||||
|
||||
const t = require('tap')
|
||||
const test = t.test
|
||||
const { test } = require('node:test')
|
||||
const FindMyWay = require('..')
|
||||
|
||||
test('Should return correct param after switching from static route', t => {
|
||||
@@ -11,7 +10,7 @@ test('Should return correct param after switching from static route', t => {
|
||||
findMyWay.on('GET', '/prefix-:id', () => {})
|
||||
findMyWay.on('GET', '/prefix-111', () => {})
|
||||
|
||||
t.same(findMyWay.find('GET', '/prefix-1111').params, { id: '1111' })
|
||||
t.assert.deepEqual(findMyWay.find('GET', '/prefix-1111').params, { id: '1111' })
|
||||
})
|
||||
|
||||
test('Should return correct param after switching from static route', t => {
|
||||
@@ -21,7 +20,7 @@ test('Should return correct param after switching from static route', t => {
|
||||
findMyWay.on('GET', '/prefix-111', () => {})
|
||||
findMyWay.on('GET', '/prefix-:id/hello', () => {})
|
||||
|
||||
t.same(findMyWay.find('GET', '/prefix-1111/hello').params, { id: '1111' })
|
||||
t.assert.deepEqual(findMyWay.find('GET', '/prefix-1111/hello').params, { id: '1111' })
|
||||
})
|
||||
|
||||
test('Should return correct param after switching from parametric route', t => {
|
||||
@@ -32,7 +31,7 @@ test('Should return correct param after switching from parametric route', t => {
|
||||
findMyWay.on('GET', '/prefix-:id/hello', () => {})
|
||||
findMyWay.on('GET', '/:id', () => {})
|
||||
|
||||
t.same(findMyWay.find('GET', '/prefix-1111-hello').params, { id: 'prefix-1111-hello' })
|
||||
t.assert.deepEqual(findMyWay.find('GET', '/prefix-1111-hello').params, { id: 'prefix-1111-hello' })
|
||||
})
|
||||
|
||||
test('Should return correct params after switching from parametric route', t => {
|
||||
@@ -43,7 +42,7 @@ test('Should return correct params after switching from parametric route', t =>
|
||||
findMyWay.on('GET', '/test/:param1/test/:param2/prefix-:id/hello', () => {})
|
||||
findMyWay.on('GET', '/test/:param1/test/:param2/:id', () => {})
|
||||
|
||||
t.same(findMyWay.find('GET', '/test/value1/test/value2/prefix-1111-hello').params, {
|
||||
t.assert.deepEqual(findMyWay.find('GET', '/test/value1/test/value2/prefix-1111-hello').params, {
|
||||
param1: 'value1',
|
||||
param2: 'value2',
|
||||
id: 'prefix-1111-hello'
|
||||
|
||||
Reference in New Issue
Block a user