Merge pull request #2789 from SergioCrisostomo/upgrade-karma-sauce-launcher
[mootools.git] / README.md
blob4edbb997d1817ea7538d7a6be0eddf0b6acd9a3b
1 # MooTools Core
3 [![Build Status](https://travis-ci.org/mootools/mootools-core.png?branch=master)](https://travis-ci.org/mootools/mootools-core)
5 [![Selenium Test Status](https://saucelabs.com/browser-matrix/MooTools-Core.svg)](https://saucelabs.com/u/MooTools-Core)
7 ---
9 This repository is for MooTools developers; not users.
10 All users should download MooTools from [MooTools.net](http://mootools.net/download "Download MooTools")
12 ---
13 ## Contribute
15 You are welcome to contribute to MooTools! What we ask of you:
17 a. __To report a bug:__
19    1. Create a [jsFiddle](http://jsfiddle.net/) with the minimal amount of code to reproduce the bug.
20    2. Create a [GitHub Issue](https://github.com/mootools/mootools-core/issues), and link to the jsFiddle.
22 b. __To fix a bug:__
24    1. Clone the repo.
25    2. Add a [spec](https://github.com/Automattic/expect.js#api).
26    3. Fix the bug.
27    4. Build and run the specs.
28    5. Push to your GitHub fork.
29    6. Create Pull Request, and send Pull Request.
32 __Do try to contribute!__ This is a community project.
35 ## Building & Testing
37 Current build process uses [Grunt](http://github.com/gruntjs), [Grunt MooTools Packager plugin](https://github.com/ibolmo/grunt-packager), and [Karma related repos](http://github.com/karma-runner/grunt-karma).
39 **By default**, the build process runs the tests (specs) relevant to the build. To build without testing see the `packager` build targets.
41 ### Building MooTools _With_ Compatibility
42 This means `1.5.1` that is compatible with: `1.4.6`, `1.3.x`, `1.2.x`, and so on.
44 **Examples**
46         grunt compat             # or
47         grunt packager:compat    # to only build the source
49 ### Building MooTools _Without_ Compatibility
50 This means `1.5.1` **without** deprecated code in `1.4.6`, `1.3.x`, `1.2.x`, and so on.
52 ``` js
53 'Proceed at your own risk'
54 See the changelog or the blog related to each version for migrating your code.
55 ```
57 **Examples**
59         grunt nocompat           # or
60         grunt packager:nocompat  # to only build the source
63 ### Advanced Building and Testing
64 See the [Gruntfile](https://github.com/mootools/mootools-core/blob/master/Gruntfile.js) and [MooTools packager](https://github.com/ibolmo/grunt-mootools-packager) for further options.
66 **Examples**
68         # with compat
69         grunt compat --file=Function    # builds with only Core/Function and dependencies, then tests against specs in Specs/Core/Function
70         grunt compat --module=Class     # tests against all specs in the Specs/Class *folder* (use --file to limit the build)
72         # without compat
73         grunt nocompat --file=Function  # builds with only Core/Function and dependencies, then tests against specs in Specs/Core/Function
74         grunt nocompat --module=Class   # tests against all specs in the Specs/Class *folder* (use --file to limit the build)
76 #### Removing Other Packager Blocks
77 You'll need to add a specific task to the Gruntfile. See [packager's documentation](https://github.com/ibolmo/grunt-mootools-packager) for more examples.
79 ### Testing locally
81 I you want to test your local repo you need just some small steps. Follow these in order:
83     $ git clone https://github.com/mootools/mootools-core  # clone the MooTools repo
84     $ cd mootools-core                                     # get into the directory
85     $ npm install                                          # install de testing tools
86     $ `npm bin`/grunt test                                 # run the specs!
89 To test a build in a local browser, you can run the `:dev` target of that build to start a test server at `http://localhost:9876/` and point your browser to it. When you're done testing, pressing `Ctrl+c` in the window running the grunt process should stop the server.
91 Example:
93         $ `npm bin`/grunt compat:dev
95 If the log is too long, or if you want to store it in a file you can do:
97     $ grunt > logs.txt   # This will create a new file called logs.txt in the local directory
99 ### Testing on Travis & Sauce Labs
101 Every new Build and Pull Request is now tested on [Travis](https://travis-ci.org/) and [Sauce Labs](https://saucelabs.com/). You can also open your own free account on [Travis](https://travis-ci.org/) and [Sauce Labs](https://saucelabs.com/) to test new code ideas there.
103 [Travis](https://travis-ci.org/) testing uses [PhantomJS](http://phantomjs.org/) which is a headless browser. When connected to [Sauce Labs](https://saucelabs.com/) then it is possible to choose any number of [different Browsers and Platforms](https://saucelabs.com/platforms). You will need in this case to change the login key so it will match your account.
105 To add new Browsers in [Sauce Labs](https://saucelabs.com/) testing you can make changes to __[Grunt/options/browsers.json](Grunt/options/browsers.json)__:
107  - add a new browser to the custom launchers already in the Gruntfile.
109                 ...
110                 chrome: {
111                         base: 'SauceLabs',
112                         platform: 'Linux',
113                         browserName: 'chrome',
114                 },
115                 ...
118  - add the chosen browser, with the correct builds to .travis.yml:
120                 env:
121                         matrix:
122                                 - BUILD='compat'     BROWSER='chrome'
124 #### Browsers, Platforms, and More
126 This test suite is ready for Travis & SauceLabs.
127 You can also run locally.
129 Support:
131  - IE
132  - Edge
133  - Firefox
134  - Safari
135  - Chrome
136  - Opera
137  - PhantomJS (headless browser)
139 ## More Information
141 [See the MooTools Wiki for more information](http://github.com/mootools/mootools-core/wikis)