apply prettier, removed flow related config and added tsconfig

This commit is contained in:
Sebastian Sdorra
2019-10-20 18:02:52 +02:00
parent 0e017dcadd
commit 490418d06e
231 changed files with 5771 additions and 30386 deletions

View File

@@ -1,18 +1,18 @@
import * as validator from './userValidation';
import * as validator from "./userValidation";
describe('test displayName validation', () => {
it('should return false', () => {
expect(validator.isDisplayNameValid('')).toBe(false);
describe("test displayName validation", () => {
it("should return false", () => {
expect(validator.isDisplayNameValid("")).toBe(false);
});
it('should return true', () => {
it("should return true", () => {
// valid names taken from ValidationUtilTest.java
const validNames = [
'Arthur Dent',
'Tricia.McMillan@hitchhiker.com',
'Ford Prefect (ford.prefect@hitchhiker.com)',
'Zaphod Beeblebrox <zaphod.beeblebrox@hitchhiker.com>',
'Marvin, der depressive Roboter',
"Arthur Dent",
"Tricia.McMillan@hitchhiker.com",
"Ford Prefect (ford.prefect@hitchhiker.com)",
"Zaphod Beeblebrox <zaphod.beeblebrox@hitchhiker.com>",
"Marvin, der depressive Roboter"
];
for (let name of validNames) {
expect(validator.isDisplayNameValid(name)).toBe(true);
@@ -20,18 +20,18 @@ describe('test displayName validation', () => {
});
});
describe('test password validation', () => {
it('should return false', () => {
describe("test password validation", () => {
it("should return false", () => {
// invalid taken from ValidationUtilTest.java
const invalid = ['', 'abc', 'aaabbbcccdddeeefffggghhhiiijjjkkk'];
const invalid = ["", "abc", "aaabbbcccdddeeefffggghhhiiijjjkkk"];
for (let password of invalid) {
expect(validator.isPasswordValid(password)).toBe(false);
}
});
it('should return true', () => {
it("should return true", () => {
// valid taken from ValidationUtilTest.java
const valid = ['secret123', 'mySuperSecretPassword'];
const valid = ["secret123", "mySuperSecretPassword"];
for (let password of valid) {
expect(validator.isPasswordValid(password)).toBe(true);
}