基本schema测试

This commit is contained in:
2025-09-22 16:00:32 +08:00
commit b70b69c886
2754 changed files with 408678 additions and 0 deletions

19
node_modules/find-my-way/test/issue-93.test.js generated vendored Normal file
View File

@@ -0,0 +1,19 @@
'use strict'
const { test } = require('node:test')
const FindMyWay = require('../')
const noop = () => {}
test('Should keep semver store when split node', t => {
t.plan(4)
const findMyWay = FindMyWay()
findMyWay.on('GET', '/t1', { constraints: { version: '1.0.0' } }, noop)
findMyWay.on('GET', '/t2', { constraints: { version: '2.1.0' } }, noop)
t.assert.ok(findMyWay.find('GET', '/t1', { version: '1.0.0' }))
t.assert.ok(findMyWay.find('GET', '/t2', { version: '2.x' }))
t.assert.ok(!findMyWay.find('GET', '/t1', { version: '2.x' }))
t.assert.ok(!findMyWay.find('GET', '/t2', { version: '1.0.0' }))
})