MatthewMueller/cheerio — comment on commit 5320d639f031e1cce126fe3fe44273e0fe955da9
File: lib/api/manipulation.js line 168
By ironchefpython:

WTF?

```Javascript
> jQuery("
foo
").replaceWith("

bar

");
[
​foo​
​]
> jQuery("
").replaceWith("

");
[

​

​]
```

Hm... let's look at the unit tests for jQuery: https://github.com/jquery/jquery/blob/master/test/unit/manipulation.js

Plenty of tests for `replaceWith`, no tests for the return value.

I'm going to guess that the return value is undetermined, I'll open a bug on jQuery asking for a deterministic result.

Might as well keep the current behavior, but you could change your tests to not reference the return value of `replaceWith`.