Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: cheeriojs/cheerio
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: c3ec1cd7bff41da0033bdc45375d77844f0f81c0
Choose a base ref
...
head repository: cheeriojs/cheerio
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 35c4917205dca9d08139c95419e2626c0689e38a
Choose a head ref
  • 18 commits
  • 21 files changed
  • 9 contributors

Commits on Feb 1, 2016

  1. Copy the full SHA
    046071a View commit details
  2. Merge pull request #672 from underdogio/dev/checkbox.radio.values.sqw…

    …ished
    
    Added default value for checkboxes/radios
    fb55 committed Feb 1, 2016

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    f500197 View commit details

Commits on Mar 11, 2016

  1. remove gittask badge

    matthewmueller committed Mar 11, 2016

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    d0551dc View commit details

Commits on Apr 9, 2016

  1. add extension for JSON require call

    fixes #836, #769
    fb55 committed Apr 9, 2016
    2

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    7b59afb View commit details

Commits on Apr 30, 2016

  1. Update Readme.md (#857)

    Add missing reference of enabled htmlparser2 option
    autarc authored and fb55 committed Apr 30, 2016

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    df39f33 View commit details

Commits on May 8, 2016

  1. Added .serialize() support. Fixes #69 (#827)

    twolfson authored and fb55 committed May 8, 2016
    Copy the full SHA
    e65ad72 View commit details

Commits on Jun 7, 2016

  1. Use individual lodash functions (#864)

    * Use individual lodash functions
    
    * Use `_` object for lodash functions
    Juan authored and fb55 committed Jun 7, 2016
    Copy the full SHA
    e7d18af View commit details

Commits on Jun 12, 2016

  1. Update versions (#870)

    - move jsdom to devDependencies
    - fix issues with benchmark upgrade
    - run benchmark on travis and test on node@6
    - update benchmark jQuery to 3.0.0
    fb55 authored Jun 12, 2016
    Copy the full SHA
    79d4e5e View commit details
  2. 0.21.0

    fb55 committed Jun 12, 2016
    Copy the full SHA
    ed60b34 View commit details
  3. Fix typo on calling _.extend (#861)

    Typo on extending objects, as it missed a t.
    Miguel Ángel authored and fb55 committed Jun 12, 2016
    Copy the full SHA
    c6612f3 View commit details
  4. Document, test, and extend static $.text method (#855)

    * Document and test static `text` method
    
    * Extend `$.text()` to operate on current root
    
    Update `$.root` to return the rendered text content of the current root
    element when no argument is specified. This increases API parity with
    the existing static methods `$.html` and``$.xml`.
    
    This change technically breaks backwards compatability, but the previous
    behavior was undocumented and untested.
    jugglinmike authored and fb55 committed Jun 12, 2016
    Copy the full SHA
    54359c9 View commit details
  5. Copy the full SHA
    4ccb41b View commit details

Commits on Jun 20, 2016

  1. Added backers and sponsors from OpenCollective

    Now backers & sponsors will appear automatically on your readme. added badges on top and buttons linking to your public page.
    piamancini authored Jun 20, 2016

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    4997e70 View commit details

Commits on Jun 23, 2016

  1. Merge pull request #881 from piamancini/patch-1

    Added backers and sponsors from OpenCollective
    matthewmueller authored Jun 23, 2016

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    010b718 View commit details
  2. readme updates

    matthewmueller committed Jun 23, 2016

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    bbceb09 View commit details
  3. Merge pull request #884 from cheeriojs/readme-cleanup

    Readme cleanup
    matthewmueller authored Jun 23, 2016

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    df55c93 View commit details

Commits on Jul 4, 2016

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    1d2e8a7 View commit details

Commits on Aug 23, 2016

  1. Release 0.21.0

    matthewmueller committed Aug 23, 2016

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    35c4917 View commit details
Showing with 350 additions and 8,945 deletions.
  1. +5 −3 .travis.yml
  2. +20 −0 History.md
  3. +138 −56 Readme.md
  4. +5 −3 benchmark/benchmark.js
  5. +0 −8,829 benchmark/jquery-2.0.3.js
  6. +2 −2 benchmark/suite.js
  7. +1 −1 index.js
  8. +27 −14 lib/api/attributes.js
  9. +5 −2 lib/api/css.js
  10. +19 −3 lib/api/forms.js
  11. +10 −6 lib/api/manipulation.js
  12. +9 −3 lib/api/traversing.js
  13. +6 −1 lib/cheerio.js
  14. +10 −5 lib/static.js
  15. +22 −12 package.json
  16. +13 −0 test/api/attributes.js
  17. +24 −0 test/api/forms.js
  18. +22 −0 test/api/utils.js
  19. +4 −2 test/cheerio.js
  20. +4 −1 test/fixtures.js
  21. +4 −2 test/xml.js
8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -2,12 +2,14 @@ language: node_js
node_js:
- "stable"
- "unstable"
- "4.2"
- "4.1"
- "6"
- "4"
- "0.12"
script: make travis-test
matrix:
fast_finish: true
allow_failures:
- node_js: "unstable"
- node_js: unstable
include:
- env: BENCHMARK=true
script: "node benchmark/benchmark.js --regex '^(?!.*highmem)'"
20 changes: 20 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@

0.21.0 / 2016-08-23
==================

* Return undefined in .prop if given an invalid element or tag (#880)
* Merge pull request #884 from cheeriojs/readme-cleanup
* readme updates
* Merge pull request #881 from piamancini/patch-1
* Added backers and sponsors from OpenCollective
* Use jQuery from the jquery module in benchmarks (#871)
* Document, test, and extend static `$.text` method (#855)
* Fix typo on calling _.extend (#861)
* Update versions (#870)
* Use individual lodash functions (#864)
* Added `.serialize()` support. Fixes #69 (#827)
* Update Readme.md (#857)
* add extension for JSON require call
* remove gittask badge
* Merge pull request #672 from underdogio/dev/checkbox.radio.values.sqwished
* Added default value for checkboxes/radios

0.20.0 / 2016-02-01
==================

194 changes: 138 additions & 56 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,35 @@
# cheerio [![Build Status](https://secure.travis-ci.org/cheeriojs/cheerio.svg?branch=master)](http://travis-ci.org/cheeriojs/cheerio) [![Gittask](https://gittask.com/cheeriojs/cheerio.svg)](https://gittask.com/cheeriojs/cheerio) [![Coverage](http://img.shields.io/coveralls/cheeriojs/cheerio.svg?branch=master&style=flat)](https://coveralls.io/r/cheeriojs/cheerio) [![Join the chat at https://gitter.im/cheeriojs/cheerio](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/cheeriojs/cheerio?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
<h1 align="center">cheerio</h1>

Fast, flexible, and lean implementation of core jQuery designed specifically for the server.
<h5 align="center">Fast, flexible & lean implementation of core jQuery designed specifically for the server.</h5>

## Introduction
Teach your server HTML.
<div align="center">
<a href="http://travis-ci.org/cheeriojs/cheerio">
<img src="https://secure.travis-ci.org/cheeriojs/cheerio.svg?branch=master" alt="Travis CI" />
</a>
<a href="https://coveralls.io/r/cheeriojs/cheerio">
<img src="http://img.shields.io/coveralls/cheeriojs/cheerio.svg?branch=master&style=flat" alt="Coverage" />
</a>
<a href="https://gitter.im/cheeriojs/cheerio?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge">
<img src="https://badges.gitter.im/Join%20Chat.svg" alt="Join the chat at https://gitter.im/cheeriojs/cheerio" />
</a>
<a href="#backers">
<img src="https://opencollective.com/cheerio/backers/badge.svg" alt="OpenCollective backers"/>
</a>
<a href="#sponsors">
<img src="https://opencollective.com/cheerio/sponsors/badge.svg" alt="OpenCollective sponsors"/>
</a>
</div>

<br />

```js
var cheerio = require('cheerio'),
$ = cheerio.load('<h2 class="title">Hello world</h2>');
let cheerio = require('cheerio')
let $ = cheerio.load('<h2 class="title">Hello world</h2>')

$('h2.title').text('Hello there!');
$('h2').addClass('welcome');
$('h2.title').text('Hello there!')
$('h2').addClass('welcome')

$.html();
$.html()
//=> <h2 class="title welcome">Hello there!</h2>
```

@@ -29,21 +46,75 @@ Cheerio works with a very simple, consistent DOM model. As a result parsing, man
__&#10049; Incredibly flexible:__
Cheerio wraps around @FB55's forgiving [htmlparser2](https://github.com/fb55/htmlparser2/). Cheerio can parse nearly any HTML or XML document.

## What about JSDOM?
I wrote cheerio because I found myself increasingly frustrated with JSDOM. For me, there were three main sticking points that I kept running into again and again:

__&#8226; JSDOM's built-in parser is too strict:__
JSDOM's bundled HTML parser cannot handle many popular sites out there today.

__&#8226; JSDOM is too slow:__
Parsing big websites with JSDOM has a noticeable delay.

__&#8226; JSDOM feels too heavy:__
The goal of JSDOM is to provide an identical DOM environment as what we see in the browser. I never really needed all this, I just wanted a simple, familiar way to do HTML manipulation.

## When I would use JSDOM

Cheerio will not solve all your problems. I would still use JSDOM if I needed to work in a browser-like environment on the server, particularly if I wanted to automate functional tests.
## Sponsors

Does your company use Cheerio in production? Please consider [sponsoring this project](https://opencollective.com/cheerio#sponsor). Your help will allow maintainers to dedicate more time and resources to its development and support.

<a href="https://opencollective.com/cheerio/sponsor/0/website" target="_blank"><img src="https://opencollective.com/cheerio/sponsor/0/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/sponsor/1/website" target="_blank"><img src="https://opencollective.com/cheerio/sponsor/1/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/sponsor/2/website" target="_blank"><img src="https://opencollective.com/cheerio/sponsor/2/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/sponsor/3/website" target="_blank"><img src="https://opencollective.com/cheerio/sponsor/3/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/sponsor/4/website" target="_blank"><img src="https://opencollective.com/cheerio/sponsor/4/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/sponsor/5/website" target="_blank"><img src="https://opencollective.com/cheerio/sponsor/5/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/sponsor/6/website" target="_blank"><img src="https://opencollective.com/cheerio/sponsor/6/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/sponsor/7/website" target="_blank"><img src="https://opencollective.com/cheerio/sponsor/7/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/sponsor/8/website" target="_blank"><img src="https://opencollective.com/cheerio/sponsor/8/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/sponsor/9/website" target="_blank"><img src="https://opencollective.com/cheerio/sponsor/9/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/sponsor/10/website" target="_blank"><img src="https://opencollective.com/cheerio/sponsor/10/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/sponsor/11/website" target="_blank"><img src="https://opencollective.com/cheerio/sponsor/11/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/sponsor/12/website" target="_blank"><img src="https://opencollective.com/cheerio/sponsor/12/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/sponsor/13/website" target="_blank"><img src="https://opencollective.com/cheerio/sponsor/13/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/sponsor/14/website" target="_blank"><img src="https://opencollective.com/cheerio/sponsor/14/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/sponsor/15/website" target="_blank"><img src="https://opencollective.com/cheerio/sponsor/15/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/sponsor/16/website" target="_blank"><img src="https://opencollective.com/cheerio/sponsor/16/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/sponsor/17/website" target="_blank"><img src="https://opencollective.com/cheerio/sponsor/17/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/sponsor/18/website" target="_blank"><img src="https://opencollective.com/cheerio/sponsor/18/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/sponsor/19/website" target="_blank"><img src="https://opencollective.com/cheerio/sponsor/19/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/sponsor/20/website" target="_blank"><img src="https://opencollective.com/cheerio/sponsor/20/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/sponsor/21/website" target="_blank"><img src="https://opencollective.com/cheerio/sponsor/21/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/sponsor/22/website" target="_blank"><img src="https://opencollective.com/cheerio/sponsor/22/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/sponsor/23/website" target="_blank"><img src="https://opencollective.com/cheerio/sponsor/23/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/sponsor/24/website" target="_blank"><img src="https://opencollective.com/cheerio/sponsor/24/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/sponsor/25/website" target="_blank"><img src="https://opencollective.com/cheerio/sponsor/25/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/sponsor/26/website" target="_blank"><img src="https://opencollective.com/cheerio/sponsor/26/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/sponsor/27/website" target="_blank"><img src="https://opencollective.com/cheerio/sponsor/27/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/sponsor/28/website" target="_blank"><img src="https://opencollective.com/cheerio/sponsor/28/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/sponsor/29/website" target="_blank"><img src="https://opencollective.com/cheerio/sponsor/29/avatar.svg"></a>

## Backers

[Become a backer](https://opencollective.com/cheerio#backer) to show your support for Cheerio and help us maintain and improve this open source project.

<a href="https://opencollective.com/cheerio/backer/0/website" target="_blank"><img src="https://opencollective.com/cheerio/backer/0/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/backer/1/website" target="_blank"><img src="https://opencollective.com/cheerio/backer/1/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/backer/2/website" target="_blank"><img src="https://opencollective.com/cheerio/backer/2/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/backer/3/website" target="_blank"><img src="https://opencollective.com/cheerio/backer/3/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/backer/4/website" target="_blank"><img src="https://opencollective.com/cheerio/backer/4/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/backer/5/website" target="_blank"><img src="https://opencollective.com/cheerio/backer/5/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/backer/6/website" target="_blank"><img src="https://opencollective.com/cheerio/backer/6/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/backer/7/website" target="_blank"><img src="https://opencollective.com/cheerio/backer/7/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/backer/8/website" target="_blank"><img src="https://opencollective.com/cheerio/backer/8/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/backer/9/website" target="_blank"><img src="https://opencollective.com/cheerio/backer/9/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/backer/10/website" target="_blank"><img src="https://opencollective.com/cheerio/backer/10/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/backer/11/website" target="_blank"><img src="https://opencollective.com/cheerio/backer/11/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/backer/12/website" target="_blank"><img src="https://opencollective.com/cheerio/backer/12/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/backer/13/website" target="_blank"><img src="https://opencollective.com/cheerio/backer/13/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/backer/14/website" target="_blank"><img src="https://opencollective.com/cheerio/backer/14/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/backer/15/website" target="_blank"><img src="https://opencollective.com/cheerio/backer/15/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/backer/16/website" target="_blank"><img src="https://opencollective.com/cheerio/backer/16/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/backer/17/website" target="_blank"><img src="https://opencollective.com/cheerio/backer/17/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/backer/18/website" target="_blank"><img src="https://opencollective.com/cheerio/backer/18/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/backer/19/website" target="_blank"><img src="https://opencollective.com/cheerio/backer/19/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/backer/20/website" target="_blank"><img src="https://opencollective.com/cheerio/backer/20/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/backer/21/website" target="_blank"><img src="https://opencollective.com/cheerio/backer/21/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/backer/22/website" target="_blank"><img src="https://opencollective.com/cheerio/backer/22/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/backer/23/website" target="_blank"><img src="https://opencollective.com/cheerio/backer/23/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/backer/24/website" target="_blank"><img src="https://opencollective.com/cheerio/backer/24/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/backer/25/website" target="_blank"><img src="https://opencollective.com/cheerio/backer/25/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/backer/26/website" target="_blank"><img src="https://opencollective.com/cheerio/backer/26/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/backer/27/website" target="_blank"><img src="https://opencollective.com/cheerio/backer/27/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/backer/28/website" target="_blank"><img src="https://opencollective.com/cheerio/backer/28/avatar.svg"></a>
<a href="https://opencollective.com/cheerio/backer/29/website" target="_blank"><img src="https://opencollective.com/cheerio/backer/29/avatar.svg"></a>

## API

@@ -97,6 +168,7 @@ These parsing options are taken directly from [htmlparser2](https://github.com/f

```js
{
withDomLvl1: true,
normalizeWhitespace: false,
xmlMode: false,
decodeEntities: true
@@ -821,6 +893,21 @@ $.xml()
//=> <media:thumbnail url="http://www.foo.com/keyframe.jpg" width="75" height="50" time="12:05:01.123"/>
```

You may also render the text content of a Cheerio object using the `text` static method:

```js
$ = cheerio.load('This is <em>content</em>.')
$.text()
//=> This is content.
```

The method may be called on the Cheerio module itself--be sure to pass a collection of nodes!

```js
$ = cheerio.load('<div>This is <em>content</em>.</div>')
cheerio.text($('div'))
//=> This is content.
```

### Miscellaneous
DOM element methods that don't fit anywhere else
@@ -886,22 +973,27 @@ Cheerio collections are made up of objects that bear some resemblence to [browse
- `childNodes`
- `lastChild`

## Screencasts
## What about JSDOM?
I wrote cheerio because I found myself increasingly frustrated with JSDOM. For me, there were three main sticking points that I kept running into again and again:

http://vimeo.com/31950192
__&#8226; JSDOM's built-in parser is too strict:__
JSDOM's bundled HTML parser cannot handle many popular sites out there today.

> This video tutorial is a follow-up to Nettut's "How to Scrape Web Pages with Node.js and jQuery", using cheerio instead of JSDOM + jQuery. This video shows how easy it is to use cheerio and how much faster cheerio is than JSDOM + jQuery.
__&#8226; JSDOM is too slow:__
Parsing big websites with JSDOM has a noticeable delay.

## Testing
__&#8226; JSDOM feels too heavy:__
The goal of JSDOM is to provide an identical DOM environment as what we see in the browser. I never really needed all this, I just wanted a simple, familiar way to do HTML manipulation.

To run the test suite, download the repository, then within the cheerio directory, run:
## When I would use JSDOM

```shell
make setup
make test
```
Cheerio will not solve all your problems. I would still use JSDOM if I needed to work in a browser-like environment on the server, particularly if I wanted to automate functional tests.

This will download the development packages and run the test suite.
## Screencasts

http://vimeo.com/31950192

> This video tutorial is a follow-up to Nettut's "How to Scrape Web Pages with Node.js and jQuery", using cheerio instead of JSDOM + jQuery. This video shows how easy it is to use cheerio and how much faster cheerio is than JSDOM + jQuery.
## Contributors

@@ -972,6 +1064,17 @@ project : cheerio

Are you using cheerio in production? Add it to the [wiki](https://github.com/cheeriojs/cheerio/wiki/Cheerio-in-Production)!

## Testing

To run the test suite, download the repository, then within the cheerio directory, run:

```shell
make setup
make test
```

This will download the development packages and run the test suite.

## Special Thanks

This library stands on the shoulders of some incredible developers. A special thanks to:
@@ -987,25 +1090,4 @@ The style, the structure, the open-source"-ness" of this library comes from stud

## License

(The MIT License)

Copyright (c) 2012 Matt Mueller &lt;mattmuelle@gmail.com&gt;

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
MIT
8 changes: 5 additions & 3 deletions benchmark/benchmark.js
Original file line number Diff line number Diff line change
@@ -33,23 +33,25 @@ suites.add('manipulation - append', 'jquery.html', {
$body.append(new Array(50).join('<div>'));
}
});
suites.add('manipulation - prepend', 'jquery.html', {

// These tests run out of memory in jsdom
suites.add('manipulation - prepend - highmem', 'jquery.html', {
setup: function($) {
return $('body');
},
test: function($, $body) {
$body.prepend(new Array(50).join('<div>'));
}
});
suites.add('manipulation - after', 'jquery.html', {
suites.add('manipulation - after - highmem', 'jquery.html', {
setup: function($) {
return $('body');
},
test: function($, $body) {
$body.after(new Array(50).join('<div>'));
}
});
suites.add('manipulation - before', 'jquery.html', {
suites.add('manipulation - before - highmem', 'jquery.html', {
setup: function($) {
return $('body');
},
Loading