New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

jsverify

Package Overview
Dependencies
Maintainers
1
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsverify - npm Package Compare versions

Comparing version 0.8.2 to 0.8.3

test-ts/oneof.ts

7

CHANGELOG.md
## Release History
- **0.8.3** — *2017-09-11* — Updates
- Remove Jasmine 1 helper
- Support async tests in Jasmine 2 helper
- Add `suchthat` docs
- Update typings: `suchthat`, and type `jsc.record`.
- **0.8.2** — *2017-04-01* — Typescript updates

@@ -146,3 +151,3 @@ - Typings fixes

- **0.4.0**-alpha4 more typify
- `suchchat` supports typify dsl
- `suchthat` supports typify dsl
- `oneof` → `elements` to be in line with QuickCheck

@@ -149,0 +154,0 @@ - Added versions of examples using typify dsl

9

lib/jsverify.d.ts

@@ -6,4 +6,4 @@ declare namespace JSVerify {

generator: Generator<T>;
show: Show<T>;
shrink: Shrink<T>;
show?: Show<T>;
shrink?: Shrink<T>;
}

@@ -96,3 +96,4 @@

function oneOf<T>(gs: Arbitrary<T>[]): Arbitrary<T>;
function oneof<T>(gs: Arbitrary<T>[]): Arbitrary<T>;
function record<T>(arbs: { [P in keyof T]: Arbitrary<T[P]> }): Arbitrary<T>;

@@ -165,3 +166,3 @@ /* tslint:disable:max-line-length */

constant<U>(u: U): Generator<U>;
oneOf<U>(gens: Generator<U>[]): Generator<U>;
oneof<U>(gens: Generator<U>[]): Generator<U>;
recursive<U>(genZ: Generator<U>, f: (u: U) => U): Generator<U>;

@@ -168,0 +169,0 @@ pair<T, U>(genA: Generator<T>, genB: Generator<U>): Generator<[T, U]>;

@@ -532,2 +532,3 @@ /* @flow weak */

/// include ./small.js
/// include ./suchthat.js
/// include ./generator.js

@@ -534,0 +535,0 @@ /// include ./shrink.js

@@ -12,2 +12,4 @@ /* @flow weak */

/**
### Restricting arbitraries
- `suchthat(arb: arbitrary a, userenv: env?, p : a -> bool): arbitrary a`

@@ -14,0 +16,0 @@ Arbitrary of values that satisfy `p` predicate. It's advised that `p`'s accept rate is high.

@@ -19,3 +19,3 @@ /* @flow weak */

- *union*: `"bool | nat"` is evaluated to `jsc.sum([jsc.bool, jsc.nat])`.
- **Note** `oneof` cannot be shrinked, because the union is untagged, we don't know which shrink to use.
- **Note** `oneof` cannot be shrunk, because the union is untagged, we don't know which shrink to use.
- *conjunction*: `"bool & nat"` is evaluated to `jsc.tuple(jsc.bool, jsc.nat)`.

@@ -22,0 +22,0 @@ - *anonymous records*: `"{ b: bool; n: nat }"` is evaluated to `jsc.record({ b: jsc.bool, n: jsc.nat })`.

{
"name": "jsverify",
"description": "Property-based testing for JavaScript.",
"version": "0.8.2",
"version": "0.8.3",
"homepage": "http://jsverify.github.io/",

@@ -31,6 +31,6 @@ "author": {

"browserify": "^14.0.0",
"chai": "^3.0.0",
"chai": "^4.1.2",
"david": "^11.0.0",
"eslint": "^3.3.1",
"esprima": "^3.0.0",
"eslint": "^4.6.1",
"esprima": "^4.0.0",
"istanbul": "^0.4.1",

@@ -37,0 +37,0 @@ "jasmine-core": "^2.4.1",

@@ -231,3 +231,3 @@ # JSVerify

- *union*: `"bool | nat"` is evaluated to `jsc.sum([jsc.bool, jsc.nat])`.
- **Note** `oneof` cannot be shrinked, because the union is untagged, we don't know which shrink to use.
- **Note** `oneof` cannot be shrunk, because the union is untagged, we don't know which shrink to use.
- *conjunction*: `"bool & nat"` is evaluated to `jsc.tuple(jsc.bool, jsc.nat)`.

@@ -432,2 +432,7 @@ - *anonymous records*: `"{ b: bool; n: nat }"` is evaluated to `jsc.record({ b: jsc.bool, n: jsc.nat })`.

### Restricting arbitraries
- `suchthat(arb: arbitrary a, userenv: env?, p : a -> bool): arbitrary a`
Arbitrary of values that satisfy `p` predicate. It's advised that `p`'s accept rate is high.
### Generator functions

@@ -645,2 +650,7 @@

- **0.8.3** &mdash; *2017-09-11* &mdash; Updates
- Remove Jasmine 1 helper
- Support async tests in Jasmine 2 helper
- Add `suchthat` docs
- Update typings: `suchthat`, and type `jsc.record`.
- **0.8.2** &mdash; *2017-04-01* &mdash; Typescript updates

@@ -789,3 +799,3 @@ - Typings fixes

- **0.4.0**-alpha4 more typify
- `suchchat` supports typify dsl
- `suchthat` supports typify dsl
- `oneof` &rarr; `elements` to be in line with QuickCheck

@@ -792,0 +802,0 @@ - Added versions of examples using typify dsl

@@ -32,1 +32,8 @@ import * as jsc from "../lib/jsverify.js";

});
describe("fails before #204", () => {
it('define only test size', () => {
const property = jsc.forall(jsc.nat, n => n >= 0);
jsc.assert(property, { size: 200 });
});
});

Sorry, the diff of this file is too big to display

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