ironSource / parquetjs

fully asynchronous, pure JavaScript implementation of the Parquet file format
MIT License
348 stars 175 forks source link

Unable to mock module using Jest #115

Open jwarykowski opened 4 years ago

jwarykowski commented 4 years ago

When attempting to mock this module with Jest we get the following error raised:

jest.mock('parquetjs')

ReferenceError: Browser is not defined

The only way around this is to create a manual mock:

__mocks__/parquetjs.js

const parquetjs = {
  ParquetWriter: jest.fn(),
  ParquetSchema: jest.fn(),
  ...
}

module.exports = parquetjs
ryanau commented 3 years ago

@jwarykowski Were you able to figure out why?