
Security News
Open Source Maintainers Feeling the Weight of the EU’s Cyber Resilience Act
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
@universal-packages/logger-jest
Advanced tools
Jest matchers for Logger testing.
npm install @universal-packages/logger-jest
npm install @universal-packages/logger
Add the following to your jest.config.js
or where you configure Jest:
module.exports = {
setupFilesAfterEnv: ['@universal-packages/logger-jest']
}
import { Logger } from '@universal-packages/logger'
it('should logged log', async () => {
const logger = new Logger()
logger.log({ level: 'INFO', message: 'Hello World' })
expect(Logger).toHaveLogged({ level: 'INFO', message: 'Hello World' })
})
import { Logger } from '@universal-packages/logger'
it('should logged a total number of logs', async () => {
const logger = new Logger()
logger.log({ level: 'INFO', message: 'Hello World' })
expect(Logger).toHaveLoggedTotal(1)
})
In order for typescript to see the global types you need to reference the types somewhere in your project, normally ./src/globals.d.ts
.
/// <reference types="@universal-packages/logger-jest" />
This library is developed in TypeScript and shipped fully typed.
The development of this library happens in the open on GitHub, and we are grateful to the community for contributing bugfixes and improvements. Read below to learn how you can take part in improving this library.
FAQs
Jest matchers for Universal Logger
The npm package @universal-packages/logger-jest receives a total of 79 weekly downloads. As such, @universal-packages/logger-jest popularity was classified as not popular.
We found that @universal-packages/logger-jest demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.