Sign Up Now!

Sign up and get personalized intelligence briefing delivered daily.


Sign Up

Articles related to "jest"


Test Driven Development 101 and JS testing

  • I’m honestly still trying to get the hang of testing and I am still trying to familiarise myself with js in general.
  • Following that, we can start writing our test.
  • Name file name [file name].js Main js file: Just write the function.
  • BTW: export class MyClass doesn’t work for nodejs.
  • I have to use the module.exports keyword :( Or use babel npm package to transpire ES6 into commons target.
  • There's no magical one-liner though, you need to explicitly export the functions you want to be public.
  • Somehow, I have to name my test file test.js.
  • Not sure why yet.
  • Otherwise, the structure is pretty similar.
  • Write a function, and then use the function during the test itself.
  • Yes, seems like ES modules are experimental in node 10.
  • We’re a place where coders share, stay up-to-date and grow their careers.

save | comments | report | share on


PHP: Testing only changes

  • I recently found this awesome 😍 tool that let me run tests on only files that have been modified since the last commit, like I'm familiar with in the Jest framework.
  • Because I couldn't find a way to do this with PHPUnit Watcher or PHPUnit itself, and it worked for me with a few minor blocks, I have decided to share.
  • If you know how, please tell me in the comments.
  • The package's PHPUnit dependency was marked as ^6.0, so it wasn't working on my project, which had a dependency marked as ^7.0.
  • This is so that composer resolves the package from my GitHub fork rather than use the official package.
  • We’re a place where coders share, stay up-to-date and grow their careers.
  • We strive for transparency and don't collect excess data.

save | comments | report | share on