1
0
Fork 0

fix(test): make sure chai does not compare prototypes

This commit is contained in:
Sean Sube 2022-11-23 08:31:36 -06:00
parent ea13031518
commit db8dc22288
8 changed files with 9 additions and 7 deletions

View File

@ -8,5 +8,5 @@
<b>Signature:</b> <b>Signature:</b>
```typescript ```typescript
export declare type AllowedBufferEncoding = 'ascii' | 'utf-8'; export type AllowedBufferEncoding = 'ascii' | 'utf-8';
``` ```

View File

@ -8,5 +8,5 @@
<b>Signature:</b> <b>Signature:</b>
```typescript ```typescript
export declare type ChildSpawner = typeof spawn; export type ChildSpawner = typeof spawn;
``` ```

View File

@ -9,7 +9,7 @@ A `Map` or dictionary object with string keys and `TVal` values.
<b>Signature:</b> <b>Signature:</b>
```typescript ```typescript
export declare type MapLike<TVal> = Map<string, TVal> | Dict<TVal>; export type MapLike<TVal> = Map<string, TVal> | Dict<TVal>;
``` ```
<b>References:</b> [Dict](./js-utils.dict.md) <b>References:</b> [Dict](./js-utils.dict.md)

View File

@ -9,7 +9,7 @@ Value that may be nil.
<b>Signature:</b> <b>Signature:</b>
```typescript ```typescript
export declare type Maybe<T> = T | None; export type Maybe<T> = T | None;
``` ```
<b>References:</b> [None](./js-utils.none.md) <b>References:</b> [None](./js-utils.none.md)

View File

@ -14,7 +14,7 @@ Old name for None.
<b>Signature:</b> <b>Signature:</b>
```typescript ```typescript
export declare type Nil = None; export type Nil = None;
``` ```
<b>References:</b> [None](./js-utils.none.md) <b>References:</b> [None](./js-utils.none.md)

View File

@ -9,5 +9,5 @@ Unset value.
<b>Signature:</b> <b>Signature:</b>
```typescript ```typescript
export declare type None = null | undefined; export type None = null | undefined;
``` ```

View File

@ -14,7 +14,7 @@ Old name for Maybe.
<b>Signature:</b> <b>Signature:</b>
```typescript ```typescript
export declare type Optional<T> = Maybe<T>; export type Optional<T> = Maybe<T>;
``` ```
<b>References:</b> [Maybe](./js-utils.maybe.md) <b>References:</b> [Maybe](./js-utils.maybe.md)

View File

@ -46,6 +46,8 @@ describe('map utils', async () => {
over('maps of strings', dictionary(string(), string()), (it) => { over('maps of strings', dictionary(string(), string()), (it) => {
it('should convert map to dict', async (data) => { it('should convert map to dict', async (data) => {
delete data.__proto__; // hack for chai, https://github.com/chaijs/chai/issues/518
const map = new Map(Object.entries(data)); const map = new Map(Object.entries(data));
expect(makeDict(map)).to.deep.equal(data); expect(makeDict(map)).to.deep.equal(data);
}); });