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

ava-fast-check

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ava-fast-check - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

4

lib/ava-fast-check.d.ts
import test from 'ava';
import * as fc from 'fast-check';
type ArbitraryTuple<Ts> = {
declare type ArbitraryTuple<Ts> = {
[P in keyof Ts]: fc.Arbitrary<Ts[P]>;
};
type Prop<Ts extends any[]> = (...args: Ts) => boolean | void | PromiseLike<boolean | void>;
declare type Prop<Ts extends any[]> = (...args: Ts) => boolean | void | PromiseLike<boolean | void>;
export declare function testProp<Ts extends any[]>(label: string, arbitraries: ArbitraryTuple<Ts>, prop: Prop<Ts>, params?: fc.Parameters<Ts>): void;

@@ -8,0 +8,0 @@ export declare namespace testProp {

@@ -73,3 +73,5 @@ "use strict";

var _this = this;
var customParams = params || { seed: Date.now() };
var customParams = params || {};
if (customParams.seed === undefined)
customParams.seed = Date.now();
var promiseProp = wrapProp(prop);

@@ -76,0 +78,0 @@ testFn(label + " (with seed=" + customParams.seed + ")", function (t) { return __awaiter(_this, void 0, void 0, function () {

{
"name": "ava-fast-check",
"version": "1.1.1",
"version": "1.1.2",
"description": " Property based testing for AVA based on fast-check",

@@ -32,3 +32,3 @@ "main": "lib/ava-fast-check.js",

"prettier": "^1.14.2",
"ts-node": "^7.0.1",
"ts-node": "^8.0.2",
"typescript": "^3.1.6"

@@ -35,0 +35,0 @@ },

@@ -22,3 +22,5 @@ import test, { GenericTest, Context } from 'ava';

): void {
const customParams: fc.Parameters<Ts> = params || { seed: Date.now() };
const customParams: fc.Parameters<Ts> = params || {};
if (customParams.seed === undefined) customParams.seed = Date.now();
const promiseProp = wrapProp(prop);

@@ -25,0 +27,0 @@ testFn(`${label} (with seed=${customParams.seed})`, async t => {

@@ -37,3 +37,3 @@ import { testProp, fc } from '../lib/ava-fast-check';

let serialRun = false;
testProp.serial("should run first", [fc.boolean()], async a => {
testProp.serial('should run first', [fc.boolean()], async a => {
serialRun = true;

@@ -43,3 +43,3 @@ await delay(0);

});
testProp.serial("should run after", [fc.boolean()], async a => {
testProp.serial('should run after', [fc.boolean()], async a => {
return a == a && serialRun;

@@ -50,6 +50,6 @@ });

let runs = 0;
testProp.serial("should run serially", [fc.boolean()], async a => {
testProp.serial('should run serially', [fc.boolean()], async a => {
let run = runs++;
delay(a ? 1 : 0);
return a == a && runs == (run + 1);
return a == a && runs == run + 1;
});
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