Test files linted

This commit is contained in:
Angelos Chalaris
2018-08-03 10:39:26 +03:00
parent 5ef1fab5fd
commit cc7b76d0b3
153 changed files with 754 additions and 463 deletions

View File

@ -4,33 +4,45 @@ const toCamelCase = require('./toCamelCase.js');
test('toCamelCase is a Function', () => {
expect(toCamelCase).toBeInstanceOf(Function);
});
test('toCamelCase(\'some_database_field_name\') returns someDatabaseFieldName', () => {
test("toCamelCase('some_database_field_name') returns someDatabaseFieldName", () => {
expect(toCamelCase('some_database_field_name')).toBe('someDatabaseFieldName');
});
test('toCamelCase(\'Some label that needs to be camelized\') returns someLabelThatNeedsToBeCamelized', () => {
expect(toCamelCase('Some label that needs to be camelized')).toBe('someLabelThatNeedsToBeCamelized');
test("toCamelCase('Some label that needs to be camelized') returns someLabelThatNeedsToBeCamelized", () => {
expect(toCamelCase('Some label that needs to be camelized')).toBe(
'someLabelThatNeedsToBeCamelized'
);
});
test('toCamelCase(\'some-javascript-property\') return someJavascriptProperty', () => {
test("toCamelCase('some-javascript-property') return someJavascriptProperty", () => {
expect(toCamelCase('some-javascript-property')).toBe('someJavascriptProperty');
});
test('toCamelCase(\'some-mixed_string with spaces_underscores-and-hyphens\') returns someMixedStringWithSpacesUnderscoresAndHyphens', () => {
expect(toCamelCase('some-mixed_string with spaces_underscores-and-hyphens')).toBe('someMixedStringWithSpacesUnderscoresAndHyphens');
test("toCamelCase('some-mixed_string with spaces_underscores-and-hyphens') returns someMixedStringWithSpacesUnderscoresAndHyphens", () => {
expect(toCamelCase('some-mixed_string with spaces_underscores-and-hyphens')).toBe(
'someMixedStringWithSpacesUnderscoresAndHyphens'
);
});
test('toCamelCase() throws a error', () => {
expect(() => {toCamelCase(); }).toThrow();
expect(() => {
toCamelCase();
}).toThrow();
});
test('toCamelCase([]) throws a error', () => {
expect(() => {toCamelCase([]); }).toThrow();
expect(() => {
toCamelCase([]);
}).toThrow();
});
test('toCamelCase({}) throws a error', () => {
expect(() => {toCamelCase({}); }).toThrow();
expect(() => {
toCamelCase({});
}).toThrow();
});
test('toCamelCase(123) throws a error', () => {
expect(() => {toCamelCase(123); }).toThrow();
expect(() => {
toCamelCase(123);
}).toThrow();
});
let start = new Date().getTime();
toCamelCase('some-mixed_string with spaces_underscores-and-hyphens');
let end = new Date().getTime();
test('toCamelCase(some-mixed_string with spaces_underscores-and-hyphens) takes less than 2s to run', () => {
expect((end - start) < 2000).toBeTruthy();
expect(end - start < 2000).toBeTruthy();
});