Skip to content

Commit

Permalink
fix: 🐛 update tests to use the new import
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Apr 9, 2024
1 parent 922bfc9 commit 0d752eb
Show file tree
Hide file tree
Showing 29 changed files with 42 additions and 43 deletions.
4 changes: 2 additions & 2 deletions src/bencode/__tests__/BencodeDecoder.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {Writer} from '../../util/buffers/Writer';
import {Writer} from '@jsonjoy.com/util/lib/buffers/Writer';
import {utf8} from '@jsonjoy.com/util/lib/buffers/strings';
import {BencodeEncoder} from '../BencodeEncoder';
import {BencodeDecoder} from '../BencodeDecoder';
import {utf8} from '../../util/buffers/strings';

const decoder = new BencodeDecoder();

Expand Down
5 changes: 2 additions & 3 deletions src/bencode/__tests__/BencodeEncoder.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {utf8} from '../../util/buffers/strings';
import {Writer} from '../../util/buffers/Writer';
import {PackValue} from '../../types';
import {utf8} from '@jsonjoy.com/util/lib/buffers/strings';
import {Writer} from '@jsonjoy.com/util/lib/buffers/Writer';
import {BencodeEncoder} from '../BencodeEncoder';

const writer = new Writer(32);
Expand Down
4 changes: 2 additions & 2 deletions src/bencode/__tests__/automated.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {Writer} from '../../util/buffers/Writer';
import {Writer} from '@jsonjoy.com/util/lib/buffers/Writer';
import {BencodeEncoder} from '../BencodeEncoder';
import {BencodeDecoder} from '../BencodeDecoder';
import {utf8} from '../../util/buffers/strings';
import {utf8} from '@jsonjoy.com/util/lib/buffers/strings';

const writer = new Writer(8);
const encoder = new BencodeEncoder(writer);
Expand Down
2 changes: 1 addition & 1 deletion src/bson/__tests__/BsonEncoder-values.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {BSON, Decimal128, MinKey, MaxKey} from 'bson';
import {Writer} from '../../util/buffers/Writer';
import {Writer} from '@jsonjoy.com/util/lib/buffers/Writer';
import {BsonEncoder} from '../BsonEncoder';
import {
BsonBinary,
Expand Down
2 changes: 1 addition & 1 deletion src/bson/__tests__/BsonEncoder.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {BSON} from 'bson';
import {Writer} from '../../util/buffers/Writer';
import {Writer} from '@jsonjoy.com/util/lib/buffers/Writer';
import {BsonEncoder} from '../BsonEncoder';

const writer = new Writer(8);
Expand Down
2 changes: 1 addition & 1 deletion src/bson/__tests__/codec.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {BSON} from 'bson';
import {documents} from '../../__tests__/json-documents';
import {BsonEncoder} from '../BsonEncoder';
import {Writer} from '../../util/buffers/Writer';
import {Writer} from '@jsonjoy.com/util/lib/buffers/Writer';

const run = (encoder: BsonEncoder) => {
describe('JSON documents', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/cbor/__tests__/CborDecoderDag.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Writer} from '../../util/buffers/Writer';
import {Writer} from '@jsonjoy.com/util/lib/buffers/Writer';
import {CborEncoderStable} from '../CborEncoderStable';
import {CborDecoderDag} from '../CborDecoderDag';
import {JsonPackExtension} from '../../JsonPackExtension';
Expand Down
2 changes: 1 addition & 1 deletion src/cbor/__tests__/CborEncoder.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Writer} from '../../util/buffers/Writer';
import {Writer} from '@jsonjoy.com/util/lib/buffers/Writer';
import {JsonPackValue} from '../../JsonPackValue';
import {CborEncoder} from '../CborEncoder';
import {decode} from 'cbor';
Expand Down
2 changes: 1 addition & 1 deletion src/cbor/__tests__/CborEncoderDag.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Writer} from '../../util/buffers/Writer';
import {Writer} from '@jsonjoy.com/util/lib/buffers/Writer';
import {CborEncoderDag} from '../CborEncoderDag';
import {CborDecoder} from '../CborDecoder';
import {JsonPackExtension} from '../../JsonPackExtension';
Expand Down
2 changes: 1 addition & 1 deletion src/cbor/__tests__/CborEncoderStable.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Writer} from '../../util/buffers/Writer';
import {Writer} from '@jsonjoy.com/util/lib/buffers/Writer';
import {CborEncoderStable} from '../CborEncoderStable';
import {encode} from 'cborg';

Expand Down
2 changes: 1 addition & 1 deletion src/cbor/__tests__/fuzzing.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {RandomJson} from '../../json-random';
import {RandomJson} from '@jsonjoy.com/util/lib/json-random';
import {CborEncoderFast} from '../CborEncoderFast';
import {CborEncoder} from '../CborEncoder';
import {CborEncoderStable} from '../CborEncoderStable';
Expand Down
2 changes: 1 addition & 1 deletion src/cbor/__tests__/shallow-read.genShallowRead.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {genShallowReader} from '../../msgpack/shallow-read';
import {CborEncoder} from '../CborEncoder';
import {CborDecoder} from '../CborDecoder';
import {Path} from '../../json-pointer';
import {Writer} from '../../util/buffers/Writer';
import {Writer} from '@jsonjoy.com/util/lib/buffers/Writer';

const assetShallowRead = (doc: unknown, path: Path): void => {
const writer = new Writer(1);
Expand Down
2 changes: 1 addition & 1 deletion src/json/__tests__/JsonDecoder.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Writer} from '../../util/buffers/Writer';
import {Writer} from '@jsonjoy.com/util/lib/buffers/Writer';
import {JsonDecoder} from '../JsonDecoder';
import {JsonEncoder} from '../JsonEncoder';

Expand Down
4 changes: 2 additions & 2 deletions src/json/__tests__/JsonDecoderDag.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Writer} from '../../util/buffers/Writer';
import {utf8} from '../../util/buffers/strings';
import {Writer} from '@jsonjoy.com/util/lib/buffers/Writer';
import {utf8} from '@jsonjoy.com/util/lib/buffers/strings';
import {JsonEncoderDag} from '../JsonEncoderDag';
import {JsonDecoderDag} from '../JsonDecoderDag';

Expand Down
2 changes: 1 addition & 1 deletion src/json/__tests__/JsonEncoder.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Writer} from '../../util/buffers/Writer';
import {Writer} from '@jsonjoy.com/util/lib/buffers/Writer';
import {JsonValue} from '../../types';
import {JsonEncoder} from '../JsonEncoder';

Expand Down
4 changes: 2 additions & 2 deletions src/json/__tests__/JsonEncoderDag.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Writer} from '../../util/buffers/Writer';
import {utf8} from '../../util/buffers/strings';
import {Writer} from '@jsonjoy.com/util/lib/buffers/Writer';
import {utf8} from '@jsonjoy.com/util/lib/buffers/strings';
import {JsonEncoderDag} from '../JsonEncoderDag';

const writer = new Writer(16);
Expand Down
2 changes: 1 addition & 1 deletion src/json/__tests__/automated.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Writer} from '../../util/buffers/Writer';
import {Writer} from '@jsonjoy.com/util/lib/buffers/Writer';
import {JsonValue} from '../../types';
import {JsonEncoder} from '../JsonEncoder';
import {JsonEncoderStable} from '../JsonEncoderStable';
Expand Down
6 changes: 3 additions & 3 deletions src/json/__tests__/fuzzer.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {RandomJson} from '../../json-random';
import {Writer} from '../../util/buffers/Writer';
import {RandomJson} from '@jsonjoy.com/util/lib/json-random';
import {Writer} from '@jsonjoy.com/util/lib/buffers/Writer';
import {JsonValue} from '../../types';
import {JsonDecoder} from '../JsonDecoder';
import {JsonEncoder} from '../JsonEncoder';
Expand Down Expand Up @@ -29,6 +29,6 @@ const assertEncoder = (value: JsonValue) => {
test('fuzzing', () => {
for (let i = 0; i < 1000; i++) {
const json = RandomJson.generate();
assertEncoder(json);
assertEncoder(json as any);
}
}, 50000);
2 changes: 1 addition & 1 deletion src/json/__tests__/memory-leaks.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Writer} from '../../util/buffers/Writer';
import {Writer} from '@jsonjoy.com/util/lib/buffers/Writer';
import {JsonValue} from '../../types';
import {JsonEncoder} from '../JsonEncoder';
import {parse} from '../../json-binary';
Expand Down
2 changes: 1 addition & 1 deletion src/msgpack/__tests__/MsgPackDecoderFast.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {NullObject} from '../../util/NullObject';
import {NullObject} from '@jsonjoy.com/util/lib/NullObject';
import {MsgPackDecoderFast} from '../MsgPackDecoderFast';
import {MsgPackEncoderFast} from '../MsgPackEncoderFast';

Expand Down
2 changes: 1 addition & 1 deletion src/msgpack/__tests__/fuzzing.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {encode} from '@msgpack/msgpack';
import {RandomJson} from '../../json-random';
import {RandomJson} from '@jsonjoy.com/util/lib/json-random';
import {MsgPackEncoderFast} from '../MsgPackEncoderFast';
import {MsgPackDecoderFast} from '../MsgPackDecoderFast';

Expand Down
6 changes: 3 additions & 3 deletions src/resp/__tests__/RespDecoder.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {RespEncoder} from '../RespEncoder';
import {RespDecoder} from '../RespDecoder';
import {bufferToUint8Array} from '../../util/buffers/bufferToUint8Array';
import {bufferToUint8Array} from '@jsonjoy.com/util/lib/buffers/bufferToUint8Array';
import {RespAttributes, RespPush} from '../extensions';
import {Writer} from '../../util/buffers/Writer';
import {utf8} from '../../util/buffers/strings';
import {Writer} from '@jsonjoy.com/util/lib/buffers/Writer';
import {utf8} from '@jsonjoy.com/util/lib/buffers/strings';

const decode = (encoded: string | Uint8Array): unknown => {
const decoder = new RespDecoder();
Expand Down
2 changes: 1 addition & 1 deletion src/resp/__tests__/RespEncoder.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {bufferToUint8Array} from '../../util/buffers/bufferToUint8Array';
import {bufferToUint8Array} from '@jsonjoy.com/util/lib/buffers/bufferToUint8Array';
import {RespEncoder} from '../RespEncoder';
import {RespVerbatimString} from '../extensions';
const Parser = require('redis-parser');
Expand Down
4 changes: 2 additions & 2 deletions src/resp/__tests__/RespStreamingDecoder.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {RespStreamingDecoder} from '../RespStreamingDecoder';
import {RespEncoder} from '../RespEncoder';
import {concatList} from '../../util/buffers/concat';
import {concatList} from '@jsonjoy.com/util/lib/buffers/concat';
import {documents} from '../../__tests__/json-documents';
import {utf8} from '../../util/buffers/strings';
import {utf8} from '@jsonjoy.com/util/lib/buffers/strings';

const encoder = new RespEncoder();

Expand Down
2 changes: 1 addition & 1 deletion src/resp/__tests__/fuzzing.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {RandomJson} from '../../json-random';
import {RandomJson} from '@jsonjoy.com/util/lib/json-random';
import {RespEncoder} from '../RespEncoder';
import {RespDecoder} from '../RespDecoder';

Expand Down
4 changes: 2 additions & 2 deletions src/ubjson/__tests__/UbjsonDecoder.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {encode} from '@shelacek/ubjson';
import {Writer} from '../../util/buffers/Writer';
import {Writer} from '@jsonjoy.com/util/lib/buffers/Writer';
import {PackValue} from '../../types';
import {UbjsonEncoder} from '../UbjsonEncoder';
import {UbjsonDecoder} from '../UbjsonDecoder';
import {NullObject} from '../../util/NullObject';
import {NullObject} from '@jsonjoy.com/util/lib/NullObject';

const encoder = new UbjsonEncoder(new Writer(8));
const decoder = new UbjsonDecoder();
Expand Down
2 changes: 1 addition & 1 deletion src/ubjson/__tests__/UbjsonEncoder.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {decode} from '@shelacek/ubjson';
import {Writer} from '../../util/buffers/Writer';
import {Writer} from '@jsonjoy.com/util/lib/buffers/Writer';
import {PackValue} from '../../types';
import {UbjsonEncoder} from '../UbjsonEncoder';

Expand Down
2 changes: 1 addition & 1 deletion src/ubjson/__tests__/automated.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Writer} from '../../util/buffers/Writer';
import {Writer} from '@jsonjoy.com/util/lib/buffers/Writer';
import {JsonValue} from '../../types';
import {UbjsonEncoder} from '../UbjsonEncoder';
import {UbjsonDecoder} from '../UbjsonDecoder';
Expand Down
6 changes: 3 additions & 3 deletions src/ubjson/__tests__/fuzzer.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {RandomJson} from '../../json-random';
import {Writer} from '../../util/buffers/Writer';
import {RandomJson} from '@jsonjoy.com/util/lib/json-random';
import {Writer} from '@jsonjoy.com/util/lib/buffers/Writer';
import {JsonValue} from '../../types';
import {UbjsonEncoder} from '../UbjsonEncoder';
import {UbjsonDecoder} from '../UbjsonDecoder';
Expand Down Expand Up @@ -29,7 +29,7 @@ const assertEncoder = (value: JsonValue) => {
test('fuzzing', () => {
for (let i = 0; i < 1000; i++) {
const json = RandomJson.generate();
assertEncoder(json);
assertEncoder(json as any);
}
}, 50000);

Expand Down

0 comments on commit 0d752eb

Please sign in to comment.