-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from m-avagyan/unit-tests-setup
Unit tests setup
- Loading branch information
Showing
11 changed files
with
2,051 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module.exports = { | ||
coverageProvider: 'v8', | ||
testEnvironment: 'jsdom', | ||
testPathIgnorePatterns: ['<rootDir>/node_modules/', '<rootDir>/dist/'], | ||
transform: { | ||
'^.+\\.(ts|tsx)$': '@swc/jest', | ||
'^.+\\.(js|jsx)$': '@swc/jest', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import classcraft from 'classcraft'; | ||
|
||
describe('Test classcraft joining.', () => { | ||
it('Should merge all arguments if the type of arg is string.', () => { | ||
const result = classcraft('test-1', 'test-2', 'test-3'); | ||
const expected = 'test-1 test-2 test-3'; | ||
|
||
expect(result).toEqual(expected); | ||
}); | ||
|
||
it('Should merge only truthy valued properties.', () => { | ||
const result = classcraft({ 'test-1': true }, { 'test-2': false, 'test-3': true }, { 'test-4': undefined }); | ||
const expected = 'test-1 test-3'; | ||
|
||
expect(result).toEqual(expected); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { getFileType } from 'ublob'; | ||
|
||
describe('Get file type tests.', () => { | ||
it('Should throw exception error if argument is not string.', () => { | ||
try { | ||
// @ts-ignore | ||
const result = getFileType(1); | ||
|
||
expect(result).toThrowError('The parameter must be a blob string.'); | ||
} catch {} | ||
}); | ||
|
||
it('Should throw exception error if file type not supported.', () => { | ||
try { | ||
const result = getFileType('unsupported-file'); | ||
|
||
expect(result).toThrowError('The file type is not supported.'); | ||
} catch {} | ||
}); | ||
|
||
it('Should return file type.', () => { | ||
const result = getFileType('blob-start:application/pdf;string:'); | ||
|
||
expect(result).toEqual('application/pdf'); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import styled from 'styled-components'; | ||
|
||
export const Loader = styled.div` | ||
font-size: 20px; | ||
line-height: 24px; | ||
font-weight: bold; | ||
text-align: center; | ||
color: #000; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import React from 'react'; | ||
|
||
import * as Styled from './index.styled'; | ||
|
||
function Loader() { | ||
return <Styled.Loader>Loading...</Styled.Loader>; | ||
} | ||
|
||
export default Loader; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.