From the course: Node.js: Web Servers, Tests, and Deployment
Unlock the full course today
Join today to access over 24,400 courses taught by industry experts.
Configuring Babel with Jest - Node.js Tutorial
From the course: Node.js: Web Servers, Tests, and Deployment
Configuring Babel with Jest
- [Instructor] In order to write some tests for our application, we actually need to do some configuration with a tool called Babel. Babel is a JavaScript compiler that you can use to make all sorts of transformations with your code. We see this a lot used with the newest versions of JavaScript that aren't compatible in every single browser. We run it through the process of working with Babel, and then we're able to use those new features right away. We also see it used and React with JSX, so we can compile all of those JSX tags to JavaScript syntax that runs in the browser. The reason we'll be doing this is for two reasons, really. We want to be able to use these import statements, and we also want to be able to work with this new syntax here, this assert syntax, and if we happen to have any brand new JavaScript syntax in our project, this would help us with that as well. So, of course, (chuckles) in order to work with this,…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.