🎉 setup tests and add some

This commit is contained in:
Kevin Van Der Werff
2019-10-22 13:21:46 +02:00
parent bf7c412dfe
commit 4bb5fde140
6 changed files with 2874 additions and 171 deletions

50
test/mockCategories.json Normal file
View File

@@ -0,0 +1,50 @@
[
{
"title": "CSS",
"slug": "/css",
"resources": [
{
"title": "CSS Grid Generator",
"desc": "Visually create your css grid and export the code.",
"url": "https://cssgrid-generator.netlify.com/",
"tags": ["generator", "grid", "layout", "visual tool"]
},
{
"title": "Keyframes Editor",
"desc": "An insanely simple way to create CSS animations",
"url": "https://keyframes.app/editor/",
"tags": ["generator", "animation", "visual tool"]
},
{
"title": "Flexbox Froggy",
"desc": "A game to learn Flexbox",
"url": "https://flexboxfroggy.com",
"tags": ["educational", "beginner"]
}
]
},
{
"title": "Design",
"slug": "/design",
"resources": [
{
"title": "UX/UI Designer Roadmap 2017",
"desc": "Roadmap to becoming a UI/UX Designer in 2017",
"url": "https://github.com/togiberlin/ui-ux-designer-roadmap",
"tags": ["career", "ui", "ux"]
},
{
"title": "Undraw",
"desc": "Free vector illustrations for your website.",
"url": "https://undraw.co",
"tags": ["illustration", "svg", "ui"]
},
{
"title": "Practical UI tips",
"desc": "7 Tips to boost your UI design.",
"url": "https://medium.com/refactoring-ui/7-practical-tips-for-cheating-at-design-40c736799886",
"tags": ["ui", "tips", "tricks"]
}
]
}
]

29
test/pure.test.js Normal file
View File

@@ -0,0 +1,29 @@
import * as P from '../utils/pure.js'
test('includesElOf 1', () => {
expect(P.includesElOf([1, 2])([2])).toBeTruthy
})
test('includesElOf 2', () => {
expect(P.includesElOf([1, 2])([3])).toBeFalsy
})
test('includesElOf 3', () => {
expect(P.includesElOf(['a', 'b'])(['a'])).toBeTruthy
})
test('includesElOf 4', () => {
expect(P.includesElOf(['aa', 'b'])(['a'])).toBeFalsy
})
test('partiallyIncludesElOf 1', () => {
expect(P.partiallyIncludesElOf(['a', 'b'], ['a'])).toBeTruthy
})
test('partiallyIncludesElOf 2', () => {
expect(P.partiallyIncludesElOf(['aa', 'b'], ['a'])).toBeTruthy
})
test('partiallyIncludesElOf 3', () => {
expect(P.partiallyIncludesElOf(['aa', 'b'], ['c'])).toBeFalsy
})