Snapshot testing has become very popular for front end-development over the last few years. The term has almost become synonymous with Jest and React, but it can be used to test more than just components.
Intern has always taken a different path in the pursuit of flexible automated web app testing. In the early days, Intern leveraged AMD modules when most other testing frameworks were not modular or only supported CommonJS modules, allowing Intern to support modular code in any environment.
Intern Recorder is a Chrome extension that can kickstart the process of creating functional tests for Intern. It was initially released in 2015 users of Intern authored test suites as AMD modules.
Intern is a popular JavaScript testing framework with an extensive feature set. While Intern has traditionally been focused on testing applications written in standard JavaScript, it has also had great support for TypeScript.
Intern is complete JavaScript test stack, with support for the entire testing lifecycle. Intern 4 keeps many of the internals of Intern 3, but updates the external interface and usage model to better fit into modern workflows.
Intern is an incredibly powerful and feature-rich approach to all types of JavaScript and TypeScript testing. Intern 4 is a major update refactored in TypeScript and with much improved support for modern language features and support for ESM as well as bundlers like webpack.
Unless you have a time machine or a TARDIS, it’s pretty rare to have solid documentation in place before an open source project is released! While we’re getting close to a beta release with the Intern 4 and while we still have a fair amount of documentation and refinements to complete, a number of people have started using Intern 4 to leverage its support for easier testing with modern ES6+ and/or TypeScript features. Intern 4 has many benefits and improvements over Intern 3 and previous approaches to testing.
Test early, test often, and test some more. Why put our heart and soul into our web applications only to be let down because we are not completely testing them.
Since we released Intern in 2013, the state of JavaScript testing has changed substantially. The JavaScript world was a very different place.
The motivation for Intern 4 is to make it easier to author tests with ES6+ features within tests, with or without transpilation. Want to skim? Here’s the Intern Roadmap which lists our high level status for each Intern release going forward.
As the new year starts to unfold, it’s time to take a quick look at the things our team at SitePen resolves to do this year. Too often, we see large enterprise customers who have multiple teams creating the same features, without having a simple way to share and maintain code over time.
Thanks to a generous Mozilla Open Source Support program award, Intern has expanded its testing ecosystem to include new and robust sets of tools. Engineers can now easily write tests to benchmark sections of code, test for accessibility (a11y) support, and test for visual differences.
Intern already has a wide array of capabilities and today we’re pleased to announce one more: accessibility testing. Thanks to a generous award from Mozilla Open Source Support we’ve created the intern-a11y plugin, which allows users to run accessibility tests on pages or components using Intern.
Today we’re pleased to announce the release of Intern 3.4. This release brings usability enhancements and bugfixes, including a new benchmarking mode! We’ve outlined some of the features below, but as always, visit the release notes for more details.
With Intern you can easily run tests using your local machine’s web browser or on any other machine running a Selenium server. Sometimes a project will need to be tested across a wide range of platforms and browsers, more than an individual user or even an enterprise may have available.
SitePen Support is a service used by companies to improve the productivity and efficiency of their enterprise development teams. Our customers often ask questions about best practices when using various development tools for modern JavaScript and TypeScript development.
Today, we’re very happy to announce the release of Intern 3.3! This is the result of several months of work to improve Intern and its Dig Dug and Leadfoot dependencies, as well as the introduction of a new intern-cli package to make command-line testing configuration even easier. sitecues by Ai Squared generously sponsored some of these efforts! Intern 3.3.1 Dig Dug 1.5.0 Leadfoot 1.6.12 intern-cli 0.1.0 The two banner features in this release were version ranges and aliasing, and the SeleniumTunnel, as well as general improvement of Intern’s support for MS Edge (including a few fixes by Microsoft as the result of bugs filed during this process!).
Intern makes writing high-quality tests easier and now running the tests is even easier using intern-cli. This package provides an intern command that has a POSIX-like interface, using familiar flags and options like –help. It follows some conventions that make running Intern simpler, and provides plenty of inline help.
Intern’s Leadfoot API makes it easier to author functional tests in JavaScript. One of the fundamental concepts for authoring functional tests is to access an element within a page to test it.
Until a few years ago, our testing efforts with Dojo were focused on the Dojo Object Harness (DOH), a very early unit and functional testing suite. Developed by the Dojo Toolkit community nearly ten years ago, DOH’s main purpose was to provide functionality for unit testing JavaScript functions and custom widgets in a cross-browser compatible way.
Last fall, Mozilla announced its Mozilla Open Source Support program, specifically focused on supporting the Free & Open Source Software movement. AND THIS JUST IN: Intern was selected to receive a MOSS award in the amount of $35,000! Initially focused on awarding grants to fund projects used in its own development initiatives, Mozilla is giving back to the OS ecosystem by directly sponsoring development on these open source projects! With Intern specifically, the following improvements will be implemented: Performance with an emphasis on benchmarking and regression analysis Visual regression testing with screenshot comparison and image analysis Accessibility focused on analysis against known accessibility best practices The goal with each of these additions is to go beyond standard unit and functional testing and further automate the types of tests that developers should be running with each commit, to prevent regressions in their applications.
Intern, via the Leadfoot WebDriver library, provides a lot of low-level control over the browsers it uses to run tests. Tests can navigate to new pages, resize the browser window, examine elements on a page, and interact with controls like inputs and buttons.
Esri, the creators of great mapping technology, hosts their DevSummit every March in Palm Springs, CA. Esri creates their popular ArcGIS for JavaScript API by leveraging the Dojo Toolkit.
We’ve recently made a number of updates to Intern, providing additional flexibility and integration for writing and running tests. Seth Holladay and sitecues by Ai Squared generously sponsored some of these efforts! Intern has long supported continuous integration, officially supporting travis-ci, Jenkins, and TeamCity.
One of the nice features of testing with Intern and Leadfoot is the ease of authoring functional tests to mimic end-user behavior. The API for retrieving relevant DOM nodes is relatively straightforward, usually with a single line of code needed to get a reference to the relevant node.
Transpiling or compiling code has become a necessity today for JavaScript-based web development. Whether you are using TypeScript, Babel, Dart, Traceur, or CoffeeScript to provide additional language features, or trying to optimise your code with the likes of UglifyJS, r.js, or Closure Compiler, once you have modified your source code, you start to run into challenges.
You can use Intern to test just about everything! How about testing your Grunt tasks? Even though Intern focuses on tests authored as AMD modules, it certainly can be used to test CommonJS modules, like those used with Grunt. (As well as TypeScript, ES6 modules, and non-module code) Why would you want to test your Grunt tasks under Intern? Well, for all of the advantages that Intern brings, like integrated code coverage analysis, CI integration, etc.
So you’ve had a chance to try out Intern Recorder, our new Chrome DevTools extension for recording functional tests, and now you want to efficiently work these tests into your workflow? This post will guide you through these steps and provide helpful advice for improving the tests you record. The goal with Intern Recorder is to reduce the tedium of creating functional tests by 80-90%, but to make tests work flawlessly, you still have some steps to follow to perfect them.
Intern Recorder is a new Chrome Developer Tools extension that makes creating functional tests for Intern faster and easier. The Recorder automates test creation by recording your interactions with a page in Chrome and converting those interactions into a test file that can be downloaded and added to your Intern test suite.
Today, we’re very happy to announce the release of Intern 3! This newest version of Intern is a culmination of several months of effort to overhaul the primary portions of the test system in order to provide a more stable and robust platform for building future features and enhancements. The biggest blind spot for Intern’s self-tests in Intern 2 was the code in client.js and runner.js that actually set up the environment and kicked off testing.
This post has been updated to cover Intern 3.4 and TypeScript 2.3. Read our Intern 4 and TypeScript testing article for more recent information.
One of the primary motivations for creating Intern was to make support for continuous integration testing much easier to achieve with JavaScript-based application development. We recently converted the vast majority of the unit tests in Dojo core from DOH to Intern, in order to streamline the process of regression testing patches for Dojo 1.x.
We normally try to schedule new minor releases of Intern about once every four to six weeks, but when we are working on a major release, there will often be a larger than usual gap in the release cycle. In order to keep our users informed of what’s going on, we wanted to write about what we’ll be doing over the next six to twelve weeks for Intern 3, during which time there will be no new releases (except for possible critical patch releases).
In October, 2014, I was coerced invited to deliver a talk at the first FullStack conference in London, a conference focused on Node.js, JavaScript and hackable electronics. The conference was an interesting cross-section of all things related to JavaScript.
Today we’re pleased to announce the release of Intern 2.2. Along with improvements to existing functionality and a few bug fixes, this release includes a new console-mode reporter that provides a more detailed view of the testing process and improved rendering of differences between objects.
When writing tests for an application, it’s prudent to add mock or stub data in order to allow code to be properly tested in isolation from other parts of the system. Within a normal Dojo application, there are typically three places where mocking will occur: I/O requests, stores, and module dependencies.
Many of the best practices for writing testable code also conform to general code best practices. Code that is easily testable often also tends to be highly maintainable and resilient against changing business requirements.
Intern is a great test stack for writing full-featured unit and functional tests, with remote WebDriver-based testing (e.g. BrowserStack) and continuous integration (e.g.
Last month, we conducted a live webcast to provide an Introduction to Intern, SitePen’s open source testing framework. Our webcast covered: An overview of Intern’s numerous functional and unit testing features and capabilities Mocking objects and data Injecting dependencies Troubleshooting Future direction of Intern While it’s too late to attend this webcast and heckle us with live questions, we recorded the session and have made it available for you online: We encourage you to use Intern in your current application and then tell us about your experience.
Receive Our Latest Insights!
Sign up to receive our latest articles on JavaScript, TypeScript, and all things software development!