fatsify核心功能示例测试!!!
This commit is contained in:
16
node_modules/fast-json-stringify/test/sanitize4.test.js
generated
vendored
Normal file
16
node_modules/fast-json-stringify/test/sanitize4.test.js
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
'use strict'
|
||||
|
||||
const { test } = require('node:test')
|
||||
const build = require('..')
|
||||
|
||||
test('sanitize 4', t => {
|
||||
const payload = '(throw "pwoned")'
|
||||
|
||||
const stringify = build({
|
||||
required: [`"];${payload}//`]
|
||||
})
|
||||
|
||||
t.assert.throws(() => {
|
||||
stringify({})
|
||||
}, { message: '""];(throw "pwoned")//" is required!' })
|
||||
})
|
||||
Reference in New Issue
Block a user