intern

2018-10-11 admin

intern是什么

什么是intern,Intern. A next-generation code testing stack for JavaScript.

intern使用教程帮助文档

Intern

Software testing for humans

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

Intern logo

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

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.

<g-emoji class=“g-emoji” alias=“bulb” fallback-src=“https://assets-cdn.github.com/images/icons/emoji/unicode/1f4a1.png”>💡</g-emoji> 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.

<g-emoji class=“g-emoji” alias=“bulb” fallback-src=“https://assets-cdn.github.com/images/icons/emoji/unicode/1f4a1.png”>💡</g-emoji> 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"]
    }
}

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 9 is currently not supported.

Intern’s self-tests run against IE 10 and 11, Firefox 33 and current, Chrome 38 and current, and Safari 9 and 10, as well as Node 6 and 8.

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

Intern’s self-tests run on BrowserStack logo

本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处。

转载请注明:文章转载自 JavaScript中文网 [https://www.javascriptcn.com]

本文地址:https://www.javascriptcn.com/read-42413.html

文章标题:intern

相关文章
我怎样才能只使用JavaScript来访问Internet Explorer 11?
BoltClockdave1010提出了一个问题:How can I target only Internet Explorer 11 with JavaScript?,或许与您遇到的问题类似。 回答者 7 revs, 3 users 76...
2018-03-31
grunt-contrib-internal
grunt-contrib-internal是什么 什么是grunt-contrib-internal,Internal tasks for managing the grunt-contrib projects grunt-contri...
2018-09-12
为什么Internet Explorer在失败后在Ajax调用中不发送HTTP POST主体?
Jonathon FaustDodgyrabbit提出了一个问题:Why does Internet Explorer not send HTTP post body on Ajax call after failure?,或许与您遇到的问...
2018-03-13
Internet Explorer 11 ignores list-style:none on the first load
PhearOfRayneDavid Apltauer提出了一个问题:Internet Explorer 11 ignores list-style:none on the first load,或许与您遇到的问题类似。 回答者Dummy给出...
2018-04-24
我怎么innerwidth在Internet Explorer 8
antonjs提出了一个问题:How Do I Get innerWidth in Internet explorer 8,或许与您遇到的问题类似。 回答者CommunitySarfraz给出了该问题的处理方式: The innerWidt...
2018-03-26
检测Internet连接是否脱机?
Prakash PazhanisamyDaniel Silveira提出了一个问题:Detect the Internet connection is offline?,或许与您遇到的问题类似。 回答者keparo给出了该问题的处理方式: ...
2018-03-09
Internet Explorer 11检测
CommunityMiqdad Ali提出了一个问题:Internet Explorer 11 detection,或许与您遇到的问题类似。 回答者Royi Namir给出了该问题的处理方式: Edit 18 Nov 2016 This c...
2018-03-28
JSON是Internet Explorer中JavaScript中未定义的错误。
Dalenashishjmeshram提出了一个问题:‘JSON’ is undefined error in JavaScript in Internet Explorer,或许与您遇到的问题类似。 回答者CommunityDalen给出...
2018-03-31
我能在Internet Explorer中加载整个HTML文档到文档片段吗?
ddaAndy E提出了一个问题:Can I load an entire HTML document into a document fragment in Internet Explorer?,或许与您遇到的问题类似。 回答者Commu...
2018-04-06
回到顶部