In this exercise, Kent adds babel-register and babel-plugin-istanbul to the project. After configuring these to modules, he uses the NODE_ENV to indicate which environment is being used for each script so the correct plugins will be loaded. Since the NODE_ENV variable only works on OSX, Kent adds the cross-env module which allows it to be set cross platform. The solution to this exercise is on the FEM/07.1-transpile-tests branch.
(oriental music)…- Yeah, let's just start out with...…Well like normally you'd npm install this…but we'll just put babel register in here…and the version that you all have installed…is six point one one point six, the latest version…and we're also going to have babel plugin istanbul.…And the latest version, I think we have the latest version…one dot zero dot three.…
Doesn't matter what order these are in,…I think it's the wrong order but whatever.…And so then what we're going to do in our nyc config…is we're going to say,…"hey, we don't want you to instrument anything".…So we're going to say instrument is false…and then I'll be perfectly honest I'm not sure why we need…this next property but we do for this to work,…it's source map is false.…
I think source maps do some funny things with code…or like covering your code so that's what we're doing there.…And then we're going to add yet another property called require…and this will tell nyc "hey, before you spawn off…this mocha cli, I want you to require this thing…
Note: This course was created by Frontend Masters. It was originally released on 08/09/2016. We're pleased to host this training in our library.
- Creating an open-source library
- Linting and testing
- Code coverage
- Installing and configuring Babel
- Peer dependencies
- Forking and renaming
- Continuous integration and automating releases
Skill Level Intermediate
1. Creating an Open-Source Library
2. Linting and Testing
3. Git Hooks, Babel, and Webpack
4. Continuous Integration and Automating Releases
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.