ProjectCreation.test.ts11 lines · main
1import { expect, test } from 'vitest'
2
3import { DATABASE_PASSWORD_REGEX } from './ProjectCreation.constants'
4
5test('Regex test to surface if password contains @, : or /', () => {
6 expect(!'teststring'.match(DATABASE_PASSWORD_REGEX)).toEqual(false)
7 expect(!'test@string'.match(DATABASE_PASSWORD_REGEX)).toEqual(true)
8 expect(!'te:ststring'.match(DATABASE_PASSWORD_REGEX)).toEqual(true)
9 expect(!`tests/tring`.match(DATABASE_PASSWORD_REGEX)).toEqual(true)
10 expect(!'!#$%^&*()'.match(DATABASE_PASSWORD_REGEX)).toEqual(false)
11})