Skip to content

Commit

Permalink
Change JSONP3_NONDETERMINISTIC to JSONP3_CTS_NONDETERMINISTIC
Browse files Browse the repository at this point in the history
  • Loading branch information
jg-rp committed Mar 5, 2024
1 parent 4967cfa commit 3209042
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 9 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# JSON P3 Change Log

# Version 1.1.0 (unreleased)

**Features**

- Added `nondeterministic` to `JSONPathEnvironmentOptions` and environment variables to control nondeterminism and the location of `cts.json` when testing for compliance. See the [README](https://github.com/jg-rp/json-p3/blob/main/README.md) for a description of these environment variables.

# Version 1.0.0

[RFC 9535](https://datatracker.ietf.org/doc/html/rfc9535) has been published, replacing the [draft IETF JSONPath base](https://datatracker.ietf.org/doc/html/draft-ietf-jsonpath-base-21).
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ JSON P3 has zero runtime dependencies.

These environment variables control the location of the compliance test suite under test and if nondeterministic object iteration is enabled for those tests.

| Environment Variable | Description |
| ------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| `JSONP3_CTS` | The path to `cts.json` used by `compliance.test.ts`. Defaults to `tests/path/cts/cts.json`. |
| `JSONP3_NONDETERMINISTIC` | When set to `true`, enables nondeterministic iteration of JSON objects for `compliance.test.ts`. Defaults to `false`. |
| Environment Variable | Description |
| ----------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| `JSONP3_CTS` | The path to `cts.json` used by `compliance.test.ts`. Defaults to `tests/path/cts/cts.json`. |
| `JSONP3_CTS_NONDETERMINISTIC` | When set to `true`, enables nondeterministic iteration of JSON objects for `compliance.test.ts`. Defaults to `false`. |

## Contributing

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion performance/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ function perf(repeat) {
return (stop - start) / 1e3;
}

console.log(perf(1000));
console.log(perf(10000));
2 changes: 1 addition & 1 deletion tests/path/compliance.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const cts = JSON.parse(
);

const env = new JSONPathEnvironment({
nondeterministic: process.env.JSONP3_NONDETERMINISTIC === "true",
nondeterministic: process.env.JSONP3_CTS_NONDETERMINISTIC === "true",
});

describe("compliance test suite", () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/path/cts
Submodule cts updated 2 files
+19 −0 cts.json
+13 −0 tests/filter.json

0 comments on commit 3209042

Please sign in to comment.