Aktueller Stand
This commit is contained in:
11
backend/node_modules/find-my-way/test/store.test.js
generated
vendored
11
backend/node_modules/find-my-way/test/store.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('handler should have the store object', t => {
|
||||
@@ -9,7 +8,7 @@ test('handler should have the store object', t => {
|
||||
const findMyWay = FindMyWay()
|
||||
|
||||
findMyWay.on('GET', '/test', (req, res, params, store) => {
|
||||
t.equal(store.hello, 'world')
|
||||
t.assert.equal(store.hello, 'world')
|
||||
}, { hello: 'world' })
|
||||
|
||||
findMyWay.lookup({ method: 'GET', url: '/test', headers: {} }, null)
|
||||
@@ -22,7 +21,7 @@ test('find a store object', t => {
|
||||
|
||||
findMyWay.on('GET', '/test', fn, { hello: 'world' })
|
||||
|
||||
t.same(findMyWay.find('GET', '/test'), {
|
||||
t.assert.deepEqual(findMyWay.find('GET', '/test'), {
|
||||
handler: fn,
|
||||
params: {},
|
||||
store: { hello: 'world' },
|
||||
@@ -37,12 +36,12 @@ test('update the store', t => {
|
||||
|
||||
findMyWay.on('GET', '/test', (req, res, params, store) => {
|
||||
if (!bool) {
|
||||
t.equal(store.hello, 'world')
|
||||
t.assert.equal(store.hello, 'world')
|
||||
store.hello = 'hello'
|
||||
bool = true
|
||||
findMyWay.lookup({ method: 'GET', url: '/test', headers: {} }, null)
|
||||
} else {
|
||||
t.equal(store.hello, 'hello')
|
||||
t.assert.equal(store.hello, 'hello')
|
||||
}
|
||||
}, { hello: 'world' })
|
||||
|
||||
|
||||
Reference in New Issue
Block a user