Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jest-fixed-jsdom

Package Overview
Dependencies
Maintainers
0
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-fixed-jsdom - npm Package Compare versions

Comparing version 0.0.6 to 0.0.7

.github/workflows/release.yml

2

index.js

@@ -22,2 +22,4 @@ const JSDOMEnvironment = require('jest-environment-jsdom').default

this.global.URLSearchParams = URLSearchParams
this.global.BroadcastChannel = BroadcastChannel
}

@@ -24,0 +26,0 @@ }

const { URL: BuiltinURL } = require('node:url')
const {
BroadcastChannel: BuiltinBroadcastChannel,
} = require('node:worker_threads')

@@ -41,3 +44,5 @@ test('exposes "Blob"', async () => {

}
expect(Buffer.from(chunks)).toEqual(Buffer.from(new Uint8Array([104, 101, 108, 108, 111])))
expect(Buffer.from(chunks)).toEqual(
Buffer.from(new Uint8Array([104, 101, 108, 108, 111])),
)
})

@@ -143,4 +148,20 @@

expect(globalThis).toHaveProperty('URLSearchParams')
expect(new URL('http://localhost?other_non_mocked_flag').searchParams.has('other_non_mocked_flag')).toBe(false)
expect(new URL('http://localhost?other_non_mocked_flag').searchParams.has('mocked_flag')).toBe(true)
expect(
new URL('http://localhost?other_non_mocked_flag').searchParams.has(
'other_non_mocked_flag',
),
).toBe(false)
expect(
new URL('http://localhost?other_non_mocked_flag').searchParams.has(
'mocked_flag',
),
).toBe(true)
})
test('exposes "BroadcastChannel"', () => {
expect(globalThis).toHaveProperty('BroadcastChannel')
const channel = new BroadcastChannel('foo')
expect(channel).toBeInstanceOf(BuiltinBroadcastChannel)
channel.unref()
})

2

package.json
{
"name": "jest-fixed-jsdom",
"version": "0.0.6",
"version": "0.0.7",
"description": "A superset of the JSDOM environment for Jest that respects Node.js globals.",

@@ -5,0 +5,0 @@ "main": "./index.js",

<h1 align="center">jest-fixed-jsdom</h1>
<p align="center">A superset of the JSDOM environment for Jest that respects Node.js globals.</p>
<!-- prettier-ignore-start -->
> [!WARNING]
> **This package is never meant as a solution to anything**. This is a workaround. Please consider testing browser code in the actual browser. You can do so both in [Vitest](https://vitest.dev/guide/browser/) and in [Playwright](https://playwright.dev/docs/test-components) at the moment.
<!-- prettier-ignore-end -->
## Motivation

@@ -40,2 +45,3 @@

- `URLSearchParams`
- `BroadcastChannel`

@@ -42,0 +48,0 @@ ## Getting started

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc