Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try tests again #763

Merged
merged 4 commits into from
Oct 3, 2021
Merged

Try tests again #763

merged 4 commits into from
Oct 3, 2021

Conversation

GrosSacASac
Copy link
Contributor

3 issues remain:

 FAIL  test/unit/persistent-file.test.js
  ● Test suite failed to run

    persistent-file.test.js: The module 
factory of `jest.mock()` is not allowed to reference any out-of-scope variables.      
    Invalid variable access: jest
    
      15 |
      16 | jest.mock('fs', () => {
    > 17 |   const fs = jest.requireActual('fs');
         |              ^^^^
      18 |   return {
      19 |     ...fs,
      20 |     unlink: jest.fn(),

and 2 other issues in fixtures, that I also don't understand

@GrosSacASac GrosSacASac changed the title Try tests agains Try tests again Sep 29, 2021
@GrosSacASac GrosSacASac mentioned this pull request Sep 29, 2021
Copy link
Member

@tunnckoCore tunnckoCore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good! <3

@GrosSacASac GrosSacASac merged commit 3d7af80 into 3.x Oct 3, 2021
@GrosSacASac GrosSacASac deleted the try-tests-agains branch October 3, 2021 05:54
@jimmywarting
Copy link
Collaborator

Now i'm getting

 FAIL  test/unit/persistent-file.test.js
  ● Test suite failed to run

    ReferenceError: formidable/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, __dirname, __filename, arguments, atob, btoa, clearImmediate, clearInterval, clearTimeout, console, decodeURI, decodeURIComponent, encodeURI, encodeURIComponent, escape, eval, expect, exports, global, globalThis, isFinite, isNaN, jest, module, parseFloat, parseInt, performance, 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(),

      at File.buildCodeFrameError (node_modules/@babel/core/lib/transformation/file/file.js:248:12)
      at NodePath.buildCodeFrameError (node_modules/@babel/traverse/lib/path/index.js:144:21)
      at newFn (node_modules/@babel/traverse/lib/visitors.js:179:21)
      at NodePath._call (node_modules/@babel/traverse/lib/path/context.js:55:20)
      at NodePath.call (node_modules/@babel/traverse/lib/path/context.js:42:17)
      at NodePath.visit (node_modules/@babel/traverse/lib/path/context.js:90:31)
      at TraversalContext.visitQueue (node_modules/@babel/traverse/lib/context.js:112:16)

and

 FAIL  test/integration/fixtures.test.js (6.42 s)
  ✕ fixtures (5004 ms)

  ● fixtures

    thrown: "Exceeded timeout of 5000 ms for a test.
    Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."

      30 | };
      31 |
    > 32 | test('fixtures', (done) => {
         | ^
      33 |   const server = createServer();
      34 |   server.listen(PORT, findFixtures);
      35 |

      at test/integration/fixtures.test.js:32:1

@GrosSacASac
Copy link
Contributor Author

Yes the timeout is because 2 tests inside fail (todo) and the way it was written does not end close the tests .

jest mocking fs I have no idea how to fix it maybe open an issue in jest github to ask

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.

3 participants