1 | # Intern
|
2 |
|
3 |
|
4 |
|
5 | Software testing for humans
|
6 |
|
7 |
|
8 |
|
9 | [![CI status](https://travis-ci.org/theintern/intern.svg?branch=4.x)](https://travis-ci.org/theintern/intern)
|
10 | [![codecov](https://codecov.io/gh/theintern/intern/branch/master/graph/badge.svg)](https://codecov.io/gh/theintern/intern)
|
11 | [![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/theintern/intern.svg)](http://isitmaintained.com/project/theintern/intern 'Average time to resolve an issue')
|
12 | [![Percentage of issues still open](http://isitmaintained.com/badge/open/theintern/intern.svg)](http://isitmaintained.com/project/theintern/intern 'Percentage of issues still open')
|
13 | [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Ftheintern%2Fintern.svg?type=shield)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Ftheintern%2Fintern?ref=badge_shield)
|
14 |
|
15 | <br><p align="center"><img src="https://cdn.rawgit.com/theintern/intern/master/docs/logo.svg" alt="Intern logo" height="128"></p><br>
|
16 |
|
17 |
|
18 |
|
19 | Intern is a complete test system for JavaScript designed to help you write and
|
20 | run consistent, high-quality test cases for your JavaScript libraries and
|
21 | applications. It can be used to test _any_ JavaScript code.
|
22 |
|
23 | - Plain JavaScript code, in any module format (or no module format!)
|
24 | - Web pages generated by server-side languages (like Java, PHP, or Ruby)
|
25 | - Native or hybrid iOS, Android, and Firefox OS applications
|
26 | - TypeScript code when running in Node, with no additional config
|
27 |
|
28 | Intern is minimally prescriptive and enforces only a basic set of best practices
|
29 | designed to ensure your tests stay maintainable over time. Its extensible
|
30 | architecture allows you to write custom test interfaces, executors, and
|
31 | reporters to influence how your tests run & easily integrate with your existing
|
32 | coding environment. Intern also comes with Grunt tasks so it can be quickly
|
33 | added to existing Grunt-based workflows, and is designed to work out-of-the-box
|
34 | with popular continuous integration services like Jenkins and Travis CI.
|
35 |
|
36 | If you’re into name-dropping, Intern gets used every day by teams at Twitter,
|
37 | Stripe, Mozilla, IBM, Marriott, Philips, Zenput, Alfresco, Esri, HSBC, ING,
|
38 | Intuit, and more. It’s also the testing framework of choice for
|
39 | [growing numbers of open-source projects](https://github.com/search?p=2&q=tests+filename%3Aintern.js&ref=searchresults&type=Code&utf8=%E2%9C%93).
|
40 |
|
41 |
|
42 | > 💡 If you’re an Intern user who’s new to Intern 4, see the
|
43 | [Changes from Intern 3](docs/changes_from_3.md) document for a summary of the
|
44 | major differences. For Intern 3 documentation, please see
|
45 | [the Intern 3 README](https://github.com/theintern/intern/tree/3.4#intern).
|
46 |
|
47 | > 💡 Recently updated your browser and your WebDriver tests stopped working? You
|
48 | may need to [pin your WebDriver versions](./docs/running.md#selenium).
|
49 |
|
50 |
|
51 | ## Quick start
|
52 |
|
53 | 1. Install from npm
|
54 |
|
55 | ```sh
|
56 | $ cd /my/project
|
57 | $ npm install intern
|
58 | ```
|
59 |
|
60 | 2. Create an `intern.json` file in your project root.
|
61 |
|
62 | ```js
|
63 | {
|
64 | "suites": "tests/unit/**/*.js"
|
65 | }
|
66 | ```
|
67 |
|
68 | 3. Verify that your configuration works by running Intern and checking that no
|
69 | errors are output.
|
70 |
|
71 | ```sh
|
72 | $ ./node_modules/.bin/intern
|
73 | ```
|
74 |
|
75 | 4. Start [writing tests](docs/writing_tests.md)!
|
76 |
|
77 | ## TypeScript setup
|
78 |
|
79 | Intern installs a global variable that tests may not be aware of if nothing
|
80 | imports the base `intern` package. To ensure Intern’s types are loaded, add the
|
81 | following to your `tsconfig.json`:
|
82 |
|
83 | ```json
|
84 | {
|
85 | "compilerOptions": {
|
86 | "types": ["intern"]
|
87 | }
|
88 | }
|
89 | ```
|
90 |
|
91 | Alternatively, add a triple-slash directive to the top of your suite files:
|
92 |
|
93 | ```ts
|
94 | /// <reference types="intern" />
|
95 | ```
|
96 |
|
97 | ## Compatibility
|
98 |
|
99 | Intern can run unit tests in most browsers that support ECMAScript 5, including
|
100 | mobile browsers on Android and iOS, and in Node 6+. Note that Internet Explorer
|
101 | 9 is not supported.
|
102 |
|
103 | Intern’s self-tests run against IE 10 and 11, Firefox 36 and current, Chrome 38
|
104 | and current, and Safari 9 and 10, as well as the latest LTS and current versions
|
105 | of Node.
|
106 |
|
107 | Intern can run functional tests using WebDriver-compatible applications and
|
108 | services, including Selenium, Appium, Selendroid. It has built-in support for
|
109 | cloud testing services from [BrowserStack](https://browserstack.com),
|
110 | [CrossBrowserTesting](https://crossbrowsertesting.com),
|
111 | [SauceLabs](https://saucelabs.com), and [TestingBot](https://testingbot.com).
|
112 |
|
113 |
|
114 |
|
115 | ## More information
|
116 |
|
117 | - [Getting started](docs/getting_started.md) - Setting up Intern to test a
|
118 | project
|
119 | - [Changes from Intern 3](docs/changes_from_3.md) - Major changes from Intern 3
|
120 | to Intern 4
|
121 | - [How To](docs/how_to.md) - Quick answers to common questions
|
122 | - [Concepts](docs/concepts.md) - General testing concepts and definitions
|
123 | - [Architecture](docs/architecture.md) - How Intern is organized
|
124 | - [Configuration](docs/configuration.md) - How to configure Intern
|
125 | - [Writing tests](docs/writing_tests.md) - The various ways of writing tests
|
126 | with Intern
|
127 | - [Running](docs/running.md) - How to run Intern
|
128 | - [Extending](docs/extending.md) - Extending Intern with reporters and other
|
129 | plugins
|
130 | - [API](docs/api.md) - Summary API documentation
|
131 | - [Continuous integration](docs/ci.md) - Using Intern with CI systems
|
132 | - [Developing](docs/developing.md) - For Intern developers
|
133 | - [Contributing](CONTRIBUTING.md) - How to contribute to Intern development
|
134 |
|
135 |
|
136 | ## Get help
|
137 |
|
138 | The best place to ask questions and get answers about Intern is Stack Overflow.
|
139 | Just tag your question with `intern`. If you have more immediate questions, or
|
140 | just want to chat with other people interested in Intern, join the Gitter room
|
141 | at [theintern/intern](https://gitter.im/theintern/intern). See the
|
142 | [Help](docs/help.md) page for more information.
|
143 |
|
144 |
|
145 |
|
146 | ## License
|
147 |
|
148 | Intern is a JS Foundation project offered under the [New BSD](LICENSE) license.
|
149 |
|
150 | [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Ftheintern%2Fintern.svg?type=large)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Ftheintern%2Fintern?ref=badge_large)
|
151 |
|
152 | © [SitePen, Inc.](http://sitepen.com) and its
|
153 | [contributors](https://github.com/theintern/intern/graphs/contributors)
|
154 |
|
155 | <p align="center">Intern’s self-tests run on<br>
|
156 | <a href="https://browserstack.com"><img alt="BrowserStack logo" src="https://theintern.io/images/browserstack-logo.svg" height="32" align="middle"></a></p>
|
157 |
|
158 |
|
159 |
|
160 | {
|
161 | "api": "docs/api.json",
|
162 | "pages": [
|
163 | "docs/getting_started.md",
|
164 | "docs/changes_from_3.md",
|
165 | "docs/how_to.md",
|
166 | "docs/concepts.md",
|
167 | "docs/architecture.md",
|
168 | "docs/configuration.md",
|
169 | "docs/writing_tests.md",
|
170 | "docs/running.md",
|
171 | "docs/ci.md",
|
172 | "docs/extending.md",
|
173 | "docs/developing.md"
|
174 | ]
|
175 | }
|
176 | -->
|