Skip to content

feat: Use ES modules in src#727

Merged
GrosSacASac merged 10 commits into3.xfrom
ES-Modules
Apr 27, 2021
Merged

feat: Use ES modules in src#727
GrosSacASac merged 10 commits into3.xfrom
ES-Modules

Conversation

@GrosSacASac
Copy link
Copy Markdown
Contributor

@GrosSacASac GrosSacASac commented Apr 22, 2021

todo still:
some tests use dynamic require

@pr-triage pr-triage Bot added the PR: draft label Apr 22, 2021
@tunnckoCore
Copy link
Copy Markdown
Member

Never liked named exports. It's useful, this here is great example for cases when should not be used.

Better os and path to remain.

@GrosSacASac
Copy link
Copy Markdown
Contributor Author

should I replace
import { tmpdir } from 'os';
with
import os from 'os';
?

@GrosSacASac
Copy link
Copy Markdown
Contributor Author

I used the automatic vscode conversion initially

@GrosSacASac GrosSacASac marked this pull request as ready for review April 23, 2021 20:58
@GrosSacASac
Copy link
Copy Markdown
Contributor Author

test/unit/persistent-file.test.js
The module factory of jest.mock() is not allowed to reference any out-of-scope variables.
Invalid variable access: jest
Allowed objects: AbortController, AbortSignal, AggregateError, Array, ArrayBuffer, Atomics, BigInt, BigInt64Array, BigUint64Array, Boolean, Buffer, DataView, Date, Error, EvalError, Event, EventTarget, FinalizationRegistry, Float32Array, Float64Array, Function, Generator, GeneratorFunction, Infinity, Int16Array, Int32Array, Int8Array, InternalError, Intl, JSON, Map, Math, MessageChannel, MessageEvent, MessagePort, NaN, Number, Object, Promise, Proxy, RangeError, ReferenceError, Reflect, RegExp, Set, SharedArrayBuffer,
String, Symbol, SyntaxError, TextDecoder, TextEncoder, TypeError, URIError, URL, URLSearchParams, Uint16Array, Uint32Array, Uint8Array, Uint8ClampedArray, WeakMap, WeakRef, WeakSet, WebAssembly, arguments, clearImmediate, clearInterval, clearTimeout, console, decodeURI, decodeURIComponent, encodeURI, encodeURIComponent, escape, eval, expect, global,
globalThis, isFinite, isNaN, jest, parseFloat, parseInt, process, queueMicrotask, require, setImmediate, setInterval, setTimeout, undefined, unescape.
Note: This is a precaution to guard against uninitialized mock variables. If it is ensured that the mock is required lazily, variable names prefixed with mock (case insensitive) are permitted.

  15 |
  16 | jest.mock('fs', () => {
> 17 |   const fs = jest.requireActual('fs');
     |              ^^^^
  18 |   return {
  19 |     ...fs,
  20 |     unlink: jest.fn(),

looking for a jest expert for this one

@GrosSacASac GrosSacASac merged commit bd5a7be into 3.x Apr 27, 2021
@GrosSacASac GrosSacASac deleted the ES-Modules branch April 27, 2021 19:48
GrosSacASac added a commit that referenced this pull request Oct 30, 2021
* chore: start version 3

* feat: Use ES modules (#727)

* feat: Url search params and remove multiple (#730)

* docs: Fixed the missing "=" in options.filter (#732)

* docs: fix example

* docs: specify what part actually is

* docs: fix types

* docs: add warning for progress event

* docs: finish removing multiples in examples

* docs: add example for express as middleware

* docs: example handle common internet errors

* feat: add corepack support

* fix: corepack support

* fix: fix examples comment

* fix: fix example comment

* feat: add firstValues, readBooleans helpers (#757)

* feat: add firstValues, readBooleans helpers

* feat: export types

* docs: document helpers

* docs: fix example

* fix: #760 (#761)

* fix: fix error when there is an error

* tests: fix some of the tests  (#763)

* chore: up supertest jest and nyc

* tests: convert to import , fix some tests

* test: make malformed boundary as per comment ?

* tests: refactor

* style: fix some prettier issues (#764)

* chore: publish as 3.x tag

* docs: add changelog link

* docs: typo

Co-authored-by: Hrushikesh Das <dashrushikesh1121@gmail.com>
Co-authored-by: Jimmy Wärting <jimmy@warting.se>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants