Skip to content
This repository was archived by the owner on Mar 9, 2021. It is now read-only.

Tests framework added #98

Merged
merged 9 commits into from
Nov 10, 2017
Merged

Tests framework added #98

merged 9 commits into from
Nov 10, 2017

Conversation

M-ZubairAhmed
Copy link

Test support Libraries

  • babel-jest
  • enzyme
  • enzyme-adapter-react-16
  • enzyme-to-json
  • react-test-renderer

Polyfil library

  • raf

Presets

  • babel-preset-es2015
  • babel-preset-react

Also added a sample test for a component

@coderplex-bot
Copy link
Collaborator

coderplex-bot commented Nov 9, 2017

Deploy preview ready!

Built with commit 883ffc2

https://deploy-preview-98--coderplex.netlify.com

@elevenpassin
Copy link
Collaborator

Woah wait, how did react work before when you just only installed jsx support for babel? O_O @M-ZubairAhmed

Copy link
Contributor

@vinaypuppal vinaypuppal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you fix above requested changes.

.babelrc Outdated
@@ -8,6 +8,8 @@
},
"test": {
"presets": [
"react",
"es2015",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need of these because they are already present in next/babel preset we added below

package.json Outdated
"babel-plugin-lodash": "^3.2.11",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need of all these devDependencies I think. since we have these in .babelrc
https://github.com/coderplex/coderplex/blob/f9d9478af33be8b32cfffaa6b4e246702ddc6da9/.babelrc#L9-L14

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah.. so the magic lies with in next.js 🤔 hm never digged into it anyways

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

Copy link
Author

@M-ZubairAhmed M-ZubairAhmed Nov 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@buoyantair yes the code for next/babel is here . Also before i have included them only in test environment, totally forgot production was using only one preset. my bad
@vinaypuppal yes i havent had chance to look into next/babel implementation. You can write they bunched those presents into one and packed it with next js.

@M-ZubairAhmed
Copy link
Author

do we need to follow folder structure __tests__ ?

@vinaypuppal
Copy link
Contributor

package.json Outdated
@@ -56,15 +56,21 @@
},
"devDependencies": {
"babel-eslint": "^8.0.1",
"babel-jest": "^21.2.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need babel-jest ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed!

@vinaypuppal vinaypuppal merged commit b1572d0 into master Nov 10, 2017
@vinaypuppal vinaypuppal deleted the tests branch November 10, 2017 20:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants