在 Grunt 中使用 Intern(譯)
Intern 內建就支援 Grunt. 安裝完 Intern 後, 使用 grunt.loadTasks("path/to/intern/grunt") (Intern 1.0) 或者 grunt.loadNpmTasks('intern')(Intern 1.1+) 來載入 Grunt 任務到你的 Gruntfile 中.
在 intern-examples 倉庫裡, 有一個 Grunt Intern 任務的例子可以參考.
================================================================
Grunt support is built into Intern. Install Intern and load the Grunt task into your Gruntfile usinggrunt.loadTasks('path/to/intern/grunt'); (Intern 1.0) or grunt.loadNpmTasks('intern')(Intern 1.1+).
An example of the Grunt Intern task is available in the intern-examples repository.
Task Options 任務選項 Options available when running Intern using Grunt are the same as the options available when running Intern directly from the command-line, plus the following additional options:
Name Default Description browserstackUsername (none) The username for authentication with BrowserStack. browserstackAccessKey (none) The access key for authentication with BrowserStack. runType 'client' The execution mode in which Intern should be run. This may be either 'runner' for the automated test runner, or 'client' for the Node.js client. sauceAccessKey (none) The access key for authentication with Sauce Labs. sauceUsername (none) The username for authentication with Sauce Labs. testingbotKey (none) The user key for authentication with TestingBot. testingbotSecret (none) The secret key for authentication with TestingBot. Events
The current Grunt events are rudimentary, based on the output of the default console reporter, and do not provide much detail into the actual state of the test runner to Grunt tasks. Future versions of Intern are likely to improve to provide first-class event support, if sufficient demand exists for this feature.
Event Parameters Description intern.pass data - A string that contains the pass message. This event is emitted when a test passes. intern.fail data - A string that contains the failure message. This event is emitted when a test fails. Gruntfile example
grunt.initConfig({ intern: { someReleaseTarget: { options: { runType: 'runner', // defaults to 'client' config: 'tests/intern', reporters: [ 'console', 'lcov' ], suites: [ 'myPackage/tests/all' ] } }, anotherReleaseTarget: { /* ... */ } }});// Load the Intern taskgrunt.loadNpmTasks('intern');// Register a test task that uses Interngrunt.registerTask('test', [ 'intern' ]);// By default we just testgrunt.registerTask('default', [ 'test' ]); 源: https://github.com/theintern/intern/wiki/Using-Intern-with-Grunt
相關文章
- 在 Intern 中使用 PhantomJS (譯)JS
- toString().intern()中的intern()中的作用和使用
- grunt入門之grunt watch的使用
- String的intern方法使用場景
- 使用 intern 編寫測試程式碼
- 【grunt第一彈】30分鐘學會使用grunt打包前端程式碼前端
- grunt外掛:grunt-plug-insert
- 使用String.intern減少記憶體使用記憶體
- grunt in webstormWebORM
- 通過反編譯深入理解Java String及intern編譯Java
- 【譯】Dagger2在Android中的使用Android
- [譯] 在中國使用 FlutterFlutter
- 深入談談String.intern()在JVM的實現JVM
- 字串 Intern 機制字串
- [譯]iOS開發者在Swift中應避免過度使用@objciOSSwiftOBJ
- [譯] 在JavaScript中何時使用var、let及constJavaScript
- Grunt學習
- 安裝yeoman,grunt過程中的問題
- Java String.intern()Java
- Grunt快速入門
- [譯] $digest 在 Angular 中重生Angular
- [譯] 在PHP中使用SentryPHP
- 聊聊java String的internJava
- Java -- String的intern方法Java
- 翻譯|在Rust中怎樣panicRust
- grunt前端打包--css篇前端CSS
- 【譯】在 React 元件中使用 Refs 指南React元件
- 在 Windows 中編譯 Github 中的 GO 專案Windows編譯GithubGo
- java String的equals,intern方法Java
- [譯]在 Flutter 中如何設計 Activity 介面?Flutter
- 【譯】Arc 在 Rust 中是如何工作的Rust
- [譯]在JavaScript中建立WebAssembly模組例項JavaScriptWeb
- 多型引擎如何工作在病毒中(譯)多型
- 構建工具:grunt、Glup、webpackWeb
- grunt專案構建工具
- Grunt入門教程之(三)
- [譯]在 React & Redux 中使用 AJAX 輪詢ReactRedux
- [譯] 在 flutter 中高效地使用 BLoC 模式FlutterBloC模式