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

cypress-each

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cypress-each - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

2

package.json
{
"name": "cypress-each",
"version": "1.2.0",
"version": "1.2.1",
"description": "Simple implementation for describe.each and it.each",

@@ -5,0 +5,0 @@ "main": "src",

@@ -15,2 +15,19 @@ # cypress-each ![cypress version](https://img.shields.io/badge/cypress-8.5.0-brightgreen)

## Types
This package includes TypeScript definition for `it.each` and `describe.each`. Thus the parameter should be the right type from the array of values:
```js
it.each([
{ name: 'Joe', age: 30 },
{ name: 'Mary', age: 20 },
])('has correct types', (user) => {
// the type for the "user" should be
// name: string, age: number
expect(user).to.have.keys('name', 'age')
expect(user.name).to.be.a('string')
expect(user.age).to.be.a('number')
})
```
## Small print

@@ -17,0 +34,0 @@

@@ -5,20 +5,17 @@ // types for it.each and describe.each

declare namespace Mocha {
type TestCallback = (
this: Context,
arg0: unknown,
arg1: unknown,
arg2: unknown,
) => void
type TestCallback<T> = (this: Context, arg0: T, arg1: any, arg2: any) => void
interface TestFunction {
each: (
values: unknown[],
) => (titlePattern: string, fn: TestCallback) => void
// definition for it.each
each<T = unknown>(
values: T[],
): (titlePattern: string, fn: TestCallback<T>) => void
}
interface SuiteFunction {
each: (
values: unknown[],
) => (titlePattern: string, fn: TestCallback) => void
// definition for describe.each
each<T = unknown>(
values: T[],
): (titlePattern: string, fn: TestCallback<T>) => void
}
}
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