Skip to content

Commit 3b1163e

Browse files
committed
Move testing info to CONTRIBUTING.md
1 parent 8099146 commit 3b1163e

File tree

2 files changed

+37
-18
lines changed

2 files changed

+37
-18
lines changed

CONTRIBUTING.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Contributing
2+
3+
For running the tests, you will need:
4+
5+
* Ruby 1.9.3+ with Bundler
6+
* PhantomJS (for headless testing)
7+
8+
First run bootstrap to ensure necessary dependencies:
9+
10+
```
11+
$ script/bootstrap
12+
```
13+
14+
Then run headless tests in the console:
15+
16+
```
17+
$ script/test [<test-file>]
18+
```
19+
20+
To run tests in other browsers, start a server:
21+
22+
```
23+
$ script/server
24+
# now open http://localhost:4567/
25+
```
26+
27+
## Test structure
28+
29+
There are 3 main test modules:
30+
31+
* `test/unit/fn_pjax.js` - Primarily tests the `$.fn.pjax` method and its options
32+
* `test/unit/pjax.js` - Main comprehensive pjax functionality tests
33+
* `test/unit/pjax_fallback.js` - Tests that verify same result after navigation
34+
even if pjax is disabled (like for browsers that don't support pushState).
35+
36+
Each test drives a hidden test page in an `<iframe>`. See other tests to see how
37+
they trigger pjax by using the `frame` reference and remember to do so as well.

README.md

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -386,24 +386,6 @@ end
386386

387387
Deploying a deploy, bumping the version constant to force clients to do a full reload the next request getting the new layout and assets.
388388

389-
## Contributing
390-
391-
```
392-
$ git clone https://github.com/defunkt/jquery-pjax.git
393-
$ cd jquery-pjax/
394-
```
395-
396-
To run the test suite locally, start up the Sinatra test application.
397-
398-
```
399-
$ bundle install
400-
$ bundle exec ruby test/app.rb
401-
== Sinatra/1.4.5 has taken the stage on 4567 for development with backup from WEBrick
402-
403-
# in another tab:
404-
$ open http://localhost:4567/
405-
```
406-
407389
[compat]: http://caniuse.com/#search=pushstate
408390
[$.fn.on]: http://api.jquery.com/on/
409391
[$.ajax]: http://api.jquery.com/jQuery.ajax/

0 commit comments

Comments
 (0)