Intern 4: Getting Started

Historically, putting together a cohesive and easy-to-use testing solution for JavaScript projects has been difficult. In this course, you will learn how the Intern testing platform provides a complete solution for testing your applications.
Course info
Level
Beginner
Updated
Jan 9, 2018
Duration
2h 41m
Table of contents
Description
Course info
Level
Beginner
Updated
Jan 9, 2018
Duration
2h 41m
Description

Testing JavaScript code has traditionally involved putting together a set of libraries to build a complete testing solution. This course, Intern 4: Getting Started, covers Intern 4, a testing platform that incorporates best-in-class components to provide a complete testing solution out of the box. First, you will learn how the Intern project is structured and how it integrates many of the best testing component libraries to provide a world-class testing solution. You will then explore Intern’s testing capabilities by learning about how to create unit and functional tests. Finally, you will break out of the boundaries of your development machine and incorporate cloud testing platforms into your tests, ensuring that your applications work across all the browsers and operating systems that your customers use. When you are done with this course, you will know how to create unit and functional tests to ensure that your applications perform as expected, and be able to easily run those tests against all the environments that your users have available.

About the author
About the author

Michael Van Sickle is an application architect in Akron, Ohio. He is a mechanical engineer by training and a software engineer by choice. He is passionate about learning new programming languages and user experience design.

More from the author
The Go CLI Playbook
Intermediate
2h 8m
28 Feb 2018
Object-oriented Programming with Go
Intermediate
1h 42m
11 Aug 2017
Debugging Go Applications with Delve
Intermediate
2h 5m
10 Jul 2017
More courses by Mike Van Sickle
Section Introduction Transcripts
Section Introduction Transcripts

Course Overview
Hi everyone. My name is Michael Van Sickle, and welcome to my course, Intern 4: Getting started. I'm a software engineer at SitePen. If your experience is anything like mine, then you dread the part of a project where it's time to add the first tests. I have invariably lost a lot of time trying to find which libraries are the best fit for the project, and then spent even more time trying to get them to work together. Then came the happy day that I stumbled across the Intern testing platform. It didn't make all of the problems go away, but I have been surprised at how straightforward it makes it to start writing tests for a project. In this course, we're going to get introduced to the Intern and explore the major features that it offers. Some of the major topics that will cover include learning how Intern integrates many first class libraries to provide a rich testing experience. We'll learn how to write unit tests and functional tests. We'll learn how to quickly run those tests using Intern's command line and browser interfaces, and then we'll learn how to ensure that our applications work everywhere by running them on multiple browsers and operating systems. By the end of this course, you'll know how to integrate Intern into your JavaScript and TypeScript projects quickly and easily. Before beginning the course you should be familiar with the JavaScript language and how to use it in front-end application development. I hope you'll join me on this journey to learn how to easily write tests for your JavaScript and TypeScript projects, with the Intern 4: Getting Started course, at Pluralsight.

Introducing Intern
Hello, and welcome to this course where we are going to be learning about the Intern testing environment for JavaScript applications. Historically, creating a testing environment for JavaScript has been, well, like setting up a development environment. Many disparate tools had to be manually assembled and forced to work together. While this was certainly possible, the time required to research which components should used, and how to best incorporate them into a project's testing ecosystem, caused time to be spent that could have been devoted to developing the application itself. The Intern testing environment is a batteries-included testing solution with some pretty impressive capabilities. Not only does it expose powerful interfaces for creating exactly the tests you need, but it comes prepackaged with best in class defaults for its various components, allowing your team to get started as quickly as possible. In this course, we're going to get introduced to the Intern and learn about the primary ways that it can be used to provide a complete test solution for your application. We're going to start that journey in this module with a basic introduction. Now my goal in this first module is to help you understand what the Intern is and to get you your first taste for what it's like to work in it. And then as the course goes on we're going to go a little bit deeper. So we're going to start with a discussion of what is the Intern? So what are the motivations for the Intern and how does it go about its mission of providing a complete testing environment? Then we'll go through a short demo and show you how to install the Intern. And then we'll go in and write our first test. And that's pretty much going to be it for this module. We're then going to wrap up with a course overview where we're going to see how the rest of the course is going to dive deeper into various aspects of how you can use the Intern in your own projects. Okay, so let's get started by getting introduced to our Intern.

Writing Functional Tests
When I think of writing tests for an application, I tend to think of two types. Unit tests that are designed to ensure that the different parts of my application work as expected, and functional tests that make sure that the different parts work together properly. Well, we covered unit testing with Intern in the last module, so in this one I want to tackle functional tests. Fortunately, Intern is going to allow us to use a lot of the things that we've already learned to write these tests, so we're going to be able to focus in on writing the functional tests themselves. So we're going to start this module in a very similar way to how we started the last one. We're going to start by talking about a definition. We're going to set a common understanding about what a functional test is as we discuss them in this module. Then we're going to jump right in and learn how to write functional tests, and then we're going to talk about a concept that can help you write your functional tests in a more consistent and maintainable way, and that concept is something called a page object. So that's what we'll talk about in order to finish out this module. Okay, so let's get started by defining what a functional test is.

Running Tests Locally
Over the last couple of modules, we've talked about some of the types of tests that you can write with Intern. We have not, however, talked about where those tests can be run. I'd like to address that point in this module and the next. We'll start in this module by talking about how to execute tests on the same machine that Intern is running on, what I'm calling local tests. And as we'll see, there are three primary ways to do that. So this module is going to have a pretty simple structure. We're just going to go over the three different options that we have available, and then we're going to jump into some demos showing you how to executes tests in those three different environments. The first is using the CLI, using Intern's command-line interface, and it's actually what we've been using so far throughout this course, but there's a little bit of depth that I want to get into to show you some of the options that you have when working with Intern on the CLI. The next option that we have is running the tests in the browser. So this is a browser running on our local machine, and I'd like to show you how to execute you're tests using the browser, how we can look at results, and some options that we have when we're working in this environment. And finally, we're going to talk about the third option that is directly supported by the Intern library, and that is by using Grunt tasks to automate the execution of our test suite on our local machine. So let's get started by diving into the details of using the Intern CLI.