演示目录只保留可重建的源码。运行密钥、数据卷、依赖和带口令的本地配置不进入仓库。 Co-authored-by: Cursor <cursoragent@cursor.com>
33 lines
849 B
TypeScript
33 lines
849 B
TypeScript
import { resetReg, validPassword, VAR_REGEX } from './index'
|
|
|
|
it.each([
|
|
['abc12345', true],
|
|
['ABC12345', true],
|
|
['p@$$w0rd', true],
|
|
['abc1234', false],
|
|
['12345678', false],
|
|
['abcdefgh', false],
|
|
['pass word1', false],
|
|
['password1 ', false],
|
|
['pass\tword1', false],
|
|
])('checks the password policy for %s', (password, valid) => {
|
|
expect(validPassword.test(password)).toBe(valid)
|
|
})
|
|
|
|
describe('workflow variable references', () => {
|
|
beforeEach(() => resetReg())
|
|
afterEach(() => resetReg())
|
|
|
|
it.each([
|
|
'{{#1749783300519.text#}}',
|
|
'{{#1749783300519.llm.a.b.c#}}',
|
|
'{{#sys.query#}}',
|
|
'{{#conversation.aaa#}}',
|
|
'{{#env.a#}}',
|
|
'{{#rag.1748945155129.a#}}',
|
|
'{{#rag.shared.bbb#}}',
|
|
])('matches the complete %s reference', (variable) => {
|
|
expect(variable.match(VAR_REGEX)).toEqual([variable])
|
|
})
|
|
})
|