mirror of
https://github.com/marktext/marktext.git
synced 2025-05-02 11:01:34 +08:00
Update match-electron-accelerator.spec.js
This commit is contained in:
parent
11c8cc1e19
commit
f09b1bda77
@ -151,3 +151,14 @@ describe('Match non-character keys', () => {
|
||||
})
|
||||
)
|
||||
})
|
||||
|
||||
describe('REDoS Helpers', () => {
|
||||
it('should stop in 1 second', () => {
|
||||
const str = '#' + ' '.repeat(100000) + '\n1\n'
|
||||
const startTime = performance.now()
|
||||
getRecommendTitleFromMarkdownString(str)
|
||||
const endTime = performance.now()
|
||||
const timeTaken = endTime - startTime
|
||||
expect(timeTaken).to.be.lessThan(1000)
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user