Socket
Socket
Sign inDemoInstall

console-testing-library

Package Overview
Dependencies
217
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.2 to 0.3.0

dist/index.js

14

package.json
{
"name": "console-testing-library",
"version": "0.2.2",
"version": "0.3.0",
"description": "Testing console the right way",
"type": "module",
"main": "dist/console-testing-library.js",
"main": "dist/index.js",
"typings": "index.d.ts",
"exports": {
".": {
"require": "dist/console-testing-library.js",
"default": "index.js"
"require": "dist/index.js",
"default": "src/index.js"
},
"./pure": {
"require": "dist/pure.js",
"default": "src/pure.js"
}

@@ -19,3 +23,3 @@ },

"scripts": {
"build": "babel index.js -o dist/console-testing-library.js",
"build": "babel src -d dist",
"test": "jest",

@@ -22,0 +26,0 @@ "prepare": "yarn build && yarn test"

@@ -179,2 +179,18 @@ # `console-testing-library`

## Manually mocking with Jest
If your tests run with Jest then the `global.console` is automatically mocked. If you wish to have more control and manually mock it, then import the package from `pure` entry.
```js
import { createConsole, mockConsole } from 'console-testing-library/pure';
let restore = () => {};
beforeEach(() => {
restore = mockConsole(createConsole());
});
afterEach(() => restore());
```
## Custom matchers

@@ -181,0 +197,0 @@

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc