Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(jsdom): use jsdom Blob instead of Node, if jsdom is enabled #2086

Merged
merged 1 commit into from
Oct 1, 2022

Conversation

PatrickChen928
Copy link
Contributor

fix: #2078

@PatrickChen928 PatrickChen928 marked this pull request as ready for review September 26, 2022 10:00
@PatrickChen928
Copy link
Contributor Author

PatrickChen928 commented Sep 26, 2022

Test same to

it('uses jsdom ArrayBuffer', async () => {
const blob = new Blob(['Hello'], { type: 'text/plain' })
const arraybuffer = await new Promise<ArrayBuffer>((resolve, reject) => {
const reader = new FileReader()
reader.onload = () => resolve(reader.result as ArrayBuffer)
reader.onerror = () => reject(reader.error)
reader.readAsArrayBuffer(blob)
})
expect(arraybuffer.constructor.name).toBe('ArrayBuffer')
expect(arraybuffer instanceof ArrayBuffer).toBeTruthy()
expect(arraybuffer.constructor === ArrayBuffer).toBeTruthy()
})

@sheremet-va sheremet-va merged commit eabe66e into vitest-dev:main Oct 1, 2022
AlexKMarshall referenced this pull request in AlexKMarshall/necromunda-turbo-old Oct 7, 2022
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [@vitest/coverage-c8](https://togithub.com/vitest-dev/vitest) |
[`0.23.4` ->
`0.24.0`](https://renovatebot.com/diffs/npm/@vitest%2fcoverage-c8/0.23.4/0.24.0)
|
[![age](https://badges.renovateapi.com/packages/npm/@vitest%2fcoverage-c8/0.24.0/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/npm/@vitest%2fcoverage-c8/0.24.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/npm/@vitest%2fcoverage-c8/0.24.0/compatibility-slim/0.23.4)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/npm/@vitest%2fcoverage-c8/0.24.0/confidence-slim/0.23.4)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>vitest-dev/vitest</summary>

###
[`v0.24.0`](https://togithub.com/vitest-dev/vitest/releases/tag/v0.24.0)

[Compare
Source](https://togithub.com/vitest-dev/vitest/compare/v0.23.4...v0.24.0)

#####    🚨 Breaking Changes

- Use type module (revert
[#&#8203;1411](https://togithub.com/vitest-dev/vitest/issues/1411))  - 
by [@&#8203;bluwy](https://togithub.com/bluwy) and
[@&#8203;sheremet-va](https://togithub.com/sheremet-va) in
[https://github.com/vitest-dev/vitest/issues/1465](https://togithub.com/vitest-dev/vitest/issues/1465)
- Drop support for Vite 2  -  by
[@&#8203;antfu](https://togithub.com/antfu) and
[@&#8203;sheremet-va](https://togithub.com/sheremet-va) in
[https://github.com/vitest-dev/vitest/issues/1928](https://togithub.com/vitest-dev/vitest/issues/1928)

#####    🚀 Features

- **benchmark**: Todo mode  -  by
[@&#8203;Aslemammad](https://togithub.com/Aslemammad) in
[https://github.com/vitest-dev/vitest/issues/2057](https://togithub.com/vitest-dev/vitest/issues/2057)
- **inline-snapshot**: Support comment  -  by
[@&#8203;azaleta](https://togithub.com/azaleta) in
[https://github.com/vitest-dev/vitest/issues/2077](https://togithub.com/vitest-dev/vitest/issues/2077)

#####    🐞 Bug Fixes

- Run related test, even if test doesn't have dependencies  -  by
[@&#8203;sheremet-va](https://togithub.com/sheremet-va) in
[https://github.com/vitest-dev/vitest/issues/2043](https://togithub.com/vitest-dev/vitest/issues/2043)
- Check for asymmetricMatch before accessing  -  by
[@&#8203;sheremet-va](https://togithub.com/sheremet-va)
[<samp>(75719)</samp>](https://togithub.com/vitest-dev/vitest/commit/757199a6)
- Check hook teardown return type, closes
[#&#8203;2092](https://togithub.com/vitest-dev/vitest/issues/2092)  - 
by [@&#8203;sheremet-va](https://togithub.com/sheremet-va)
[<samp>(cba3f)</samp>](https://togithub.com/vitest-dev/vitest/commit/cba3ff09)
- Don't stop watch mode, if non-object error is thrown, close
[#&#8203;2106](https://togithub.com/vitest-dev/vitest/issues/2106)  - 
by [@&#8203;sheremet-va](https://togithub.com/sheremet-va)
[<samp>(bd677)</samp>](https://togithub.com/vitest-dev/vitest/commit/bd677017)
- Use correct source maps in stacktrace  -  by
[@&#8203;haikyuu](https://togithub.com/haikyuu) in
[https://github.com/vitest-dev/vitest/issues/2027](https://togithub.com/vitest-dev/vitest/issues/2027)
- Import CustomEventMap from vite for vite-node  -  by
[@&#8203;sheremet-va](https://togithub.com/sheremet-va) in
[https://github.com/vitest-dev/vitest/issues/2124](https://togithub.com/vitest-dev/vitest/issues/2124)
- **jsdom**: Use jsdom Blob instead of Node, if jsdom is enabled  -  by
[@&#8203;ChpShy](https://togithub.com/ChpShy) in
[https://github.com/vitest-dev/vitest/issues/2086](https://togithub.com/vitest-dev/vitest/issues/2086)

#####     [View changes on
GitHub](https://togithub.com/vitest-dev/vitest/compare/v0.23.4...v0.24.0)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click
this checkbox.

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://app.renovatebot.com/dashboard#github/AlexKMarshall/necromunda-turbo).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4yMjIuMyIsInVwZGF0ZWRJblZlciI6IjMyLjIyMi4zIn0=-->
AlexKMarshall referenced this pull request in AlexKMarshall/necromunda-turbo-old Oct 7, 2022
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [vitest](https://togithub.com/vitest-dev/vitest) | [`0.23.4` ->
`0.24.0`](https://renovatebot.com/diffs/npm/vitest/0.23.4/0.24.0) |
[![age](https://badges.renovateapi.com/packages/npm/vitest/0.24.0/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/npm/vitest/0.24.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/npm/vitest/0.24.0/compatibility-slim/0.23.4)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/npm/vitest/0.24.0/confidence-slim/0.23.4)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>vitest-dev/vitest</summary>

###
[`v0.24.0`](https://togithub.com/vitest-dev/vitest/releases/tag/v0.24.0)

[Compare
Source](https://togithub.com/vitest-dev/vitest/compare/v0.23.4...v0.24.0)

#####    🚨 Breaking Changes

- Use type module (revert
[#&#8203;1411](https://togithub.com/vitest-dev/vitest/issues/1411))  - 
by [@&#8203;bluwy](https://togithub.com/bluwy) and
[@&#8203;sheremet-va](https://togithub.com/sheremet-va) in
[https://github.com/vitest-dev/vitest/issues/1465](https://togithub.com/vitest-dev/vitest/issues/1465)
- Drop support for Vite 2  -  by
[@&#8203;antfu](https://togithub.com/antfu) and
[@&#8203;sheremet-va](https://togithub.com/sheremet-va) in
[https://github.com/vitest-dev/vitest/issues/1928](https://togithub.com/vitest-dev/vitest/issues/1928)

#####    🚀 Features

- **benchmark**: Todo mode  -  by
[@&#8203;Aslemammad](https://togithub.com/Aslemammad) in
[https://github.com/vitest-dev/vitest/issues/2057](https://togithub.com/vitest-dev/vitest/issues/2057)
- **inline-snapshot**: Support comment  -  by
[@&#8203;azaleta](https://togithub.com/azaleta) in
[https://github.com/vitest-dev/vitest/issues/2077](https://togithub.com/vitest-dev/vitest/issues/2077)

#####    🐞 Bug Fixes

- Run related test, even if test doesn't have dependencies  -  by
[@&#8203;sheremet-va](https://togithub.com/sheremet-va) in
[https://github.com/vitest-dev/vitest/issues/2043](https://togithub.com/vitest-dev/vitest/issues/2043)
- Check for asymmetricMatch before accessing  -  by
[@&#8203;sheremet-va](https://togithub.com/sheremet-va)
[<samp>(75719)</samp>](https://togithub.com/vitest-dev/vitest/commit/757199a6)
- Check hook teardown return type, closes
[#&#8203;2092](https://togithub.com/vitest-dev/vitest/issues/2092)  - 
by [@&#8203;sheremet-va](https://togithub.com/sheremet-va)
[<samp>(cba3f)</samp>](https://togithub.com/vitest-dev/vitest/commit/cba3ff09)
- Don't stop watch mode, if non-object error is thrown, close
[#&#8203;2106](https://togithub.com/vitest-dev/vitest/issues/2106)  - 
by [@&#8203;sheremet-va](https://togithub.com/sheremet-va)
[<samp>(bd677)</samp>](https://togithub.com/vitest-dev/vitest/commit/bd677017)
- Use correct source maps in stacktrace  -  by
[@&#8203;haikyuu](https://togithub.com/haikyuu) in
[https://github.com/vitest-dev/vitest/issues/2027](https://togithub.com/vitest-dev/vitest/issues/2027)
- Import CustomEventMap from vite for vite-node  -  by
[@&#8203;sheremet-va](https://togithub.com/sheremet-va) in
[https://github.com/vitest-dev/vitest/issues/2124](https://togithub.com/vitest-dev/vitest/issues/2124)
- **jsdom**: Use jsdom Blob instead of Node, if jsdom is enabled  -  by
[@&#8203;ChpShy](https://togithub.com/ChpShy) in
[https://github.com/vitest-dev/vitest/issues/2086](https://togithub.com/vitest-dev/vitest/issues/2086)

#####     [View changes on
GitHub](https://togithub.com/vitest-dev/vitest/compare/v0.23.4...v0.24.0)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click
this checkbox.

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://app.renovatebot.com/dashboard#github/AlexKMarshall/necromunda-turbo).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4yMjIuMyIsInVwZGF0ZWRJblZlciI6IjMyLjIyMi4zIn0=-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JSDOM environement: blob is not typeof Blob
2 participants