intern

A next-generation code testing stack for JavaScript.

Github星跟踪图

Intern

Software testing for humans

CI status
codecov
Average time to resolve an issue
Percentage of issues still open
FOSSA Status

⚠️ This documentation is for the development version of Intern. For the
current release version, go
here.

Intern is a complete test system for JavaScript designed to help you write and
run consistent, high-quality test cases for your JavaScript libraries and
applications. It can be used to test any JavaScript code.

  • Plain JavaScript code, in any module format (or no module format!)
  • Web pages generated by server-side languages (like Java, PHP, or Ruby)
  • Native or hybrid iOS, Android, and Firefox OS applications
  • TypeScript code when running in Node, with no additional config

Intern is minimally prescriptive and enforces only a basic set of best practices
designed to ensure your tests stay maintainable over time. Its extensible
architecture allows you to write custom test interfaces, executors, and
reporters to influence how your tests run & easily integrate with your existing
coding environment. Intern also comes with Grunt tasks so it can be quickly
added to existing Grunt-based workflows, and is designed to work out-of-the-box
with popular continuous integration services like Jenkins and Travis CI.

If you’re into name-dropping, Intern gets used every day by teams at Twitter,
Stripe, Mozilla, IBM, Marriott, Philips, Zenput, Alfresco, Esri, HSBC, ING,
Intuit, and more. It’s also the testing framework of choice for
growing numbers of open-source projects.

? If you’re an Intern user who’s new to Intern 4, see the
Changes from Intern 3 document for a summary of the
major differences. For Intern 3 documentation, please see
the Intern 3 README.

? Recently updated your browser and your WebDriver tests stopped working? You
may need to pin your WebDriver versions.

Quick start

  1. Install from npm

    $ cd /my/project
    $ npm install intern
    
  2. Create an intern.json file in your project root.

    {
      "suites": "tests/unit/**/*.js"
    }
    
  3. Verify that your configuration works by running Intern and checking that no
    errors are output.

    $ ./node_modules/.bin/intern
    
  4. Start writing tests!

TypeScript setup

Intern installs a global variable that tests may not be aware of if nothing
imports the base intern package. To ensure Intern’s types are loaded, add the
following to your tsconfig.json:

{
  "compilerOptions": {
    "types": ["intern"]
  }
}

Alternatively, add a triple-slash directive to the top of your suite files:

/// <reference types="intern" />

Compatibility

Intern can run unit tests in most browsers that support ECMAScript 5, including
mobile browsers on Android and iOS, and in Node 6+. Note that Internet Explorer
versions below 11 are not supported.

Intern’s self-tests run against IE 11, Safari 13, and the most recent few
vesions of Firefox, Chrome, and Chromium Edge, as well as the latest LTS and
current versions of Node.

Intern can run functional tests using WebDriver-compatible applications and
services, including Selenium, Appium, Selendroid. It has built-in support for
cloud testing services from BrowserStack,
CrossBrowserTesting,
SauceLabs, and TestingBot.

More information

Get help

The best place to ask questions and get answers about Intern is Stack Overflow.
Just tag your question with intern. If you have more immediate questions, or
just want to chat with other people interested in Intern, join the Gitter room
at theintern/intern. See the
Help page for more information.

License

Intern is a JS Foundation project offered under the New BSD license.

FOSSA Status

© SitePen, Inc. and its
contributors

主要指标

概览
名称与所有者theintern/intern
主编程语言TypeScript
编程语言JavaScript (语言数: 4)
平台
许可证Other
所有者活动
创建于2013-03-26 18:45:29
推送于2023-03-14 16:33:27
最后一次提交2023-01-26 20:50:29
发布数150
最新版本名称4.10.1 (发布于 )
第一版名称1.0.0-geezer (发布于 2013-04-30 19:40:54)
用户参与
星数4.4k
关注者数112
派生数306
提交数1.4k
已启用问题?
问题数912
打开的问题数129
拉请求数60
打开的拉请求数11
关闭的拉请求数222
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?