ProjectCreation.test.ts11 lines · main
| 1 | import { expect, test } from 'vitest' |
| 2 | |
| 3 | import { DATABASE_PASSWORD_REGEX } from './ProjectCreation.constants' |
| 4 | |
| 5 | test('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 | }) |