UNPKG

7.12 kBMarkdownView Raw
1# Intern
2
3<!-- start-github-only -->
4
5Software testing for humans
6
7<!--[![Build Status](https://travis-ci.org/theintern/intern.svg?branch=master)](https://travis-ci.org/theintern/intern)-->
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<!-- end-github-only -->
18
19Intern is a complete test system for JavaScript designed to help you write and
20run consistent, high-quality test cases for your JavaScript libraries and
21applications. 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
28Intern is minimally prescriptive and enforces only a basic set of best practices
29designed to ensure your tests stay maintainable over time. Its extensible
30architecture allows you to write custom test interfaces, executors, and
31reporters to influence how your tests run & easily integrate with your existing
32coding environment. Intern also comes with Grunt tasks so it can be quickly
33added to existing Grunt-based workflows, and is designed to work out-of-the-box
34with popular continuous integration services like Jenkins and Travis CI.
35
36If you’re into name-dropping, Intern gets used every day by teams at Twitter,
37Stripe, Mozilla, IBM, Marriott, Philips, Zenput, Alfresco, Esri, HSBC, ING,
38Intuit, 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<!-- prettier-ignore-start -->
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<!-- prettier-ignore-end -->
50
51## Quick start
52
531. Install from npm
54
55 ```sh
56 $ cd /my/project
57 $ npm install intern
58 ```
59
602. Create an `intern.json` file in your project root.
61
62 ```js
63 {
64 "suites": "tests/unit/**/*.js"
65 }
66 ```
67
683. 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
754. Start [writing tests](docs/writing_tests.md)!
76
77## TypeScript setup
78
79Intern installs a global variable that tests may not be aware of if nothing
80imports the base `intern` package. To ensure Intern’s types are loaded, add the
81following to your `tsconfig.json`:
82
83```json
84{
85 "compilerOptions": {
86 "types": ["intern"]
87 }
88}
89```
90
91Alternatively, add a triple-slash directive to the top of your suite files:
92
93```ts
94/// <reference types="intern" />
95```
96
97## Compatibility
98
99Intern can run unit tests in most browsers that support ECMAScript 5, including
100mobile browsers on Android and iOS, and in Node 6+. Note that Internet Explorer
1019 is not supported.
102
103Intern’s self-tests run against IE 10 and 11, Firefox 36 and current, Chrome 38
104and current, and Safari 9 and 10, as well as the latest LTS and current versions
105of Node.
106
107Intern can run functional tests using WebDriver-compatible applications and
108services, including Selenium, Appium, Selendroid. It has built-in support for
109cloud testing services from [BrowserStack](https://browserstack.com),
110[CrossBrowserTesting](https://crossbrowsertesting.com),
111[SauceLabs](https://saucelabs.com), and [TestingBot](https://testingbot.com).
112
113<!-- start-github-only -->
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 <!-- end-github-only -->
135
136## Get help
137
138The best place to ask questions and get answers about Intern is Stack Overflow.
139Just tag your question with `intern`. If you have more immediate questions, or
140just want to chat with other people interested in Intern, join the Gitter room
141at [theintern/intern](https://gitter.im/theintern/intern). See the
142[Help](docs/help.md) page for more information.
143
144<!-- start-github-only -->
145
146## License
147
148Intern 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<!-- end-github-only -->
158
159<!-- doc-viewer-config
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-->