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

chore: add support for cjs #10

Closed
wants to merge 1 commit into from
Closed

Conversation

henrinormak
Copy link

This should resolve #6

Tested it out in CJS and it seemed to work, but as I'm not too familiar with tsup, looking for feedback

@zfben
Copy link
Contributor

zfben commented Apr 13, 2024

@henrinormak did you test it in jest? I found some wired bug when run it in jest.

@henrinormak
Copy link
Author

henrinormak commented Apr 15, 2024

I did test it, what bug did you find? In a really simple setup where I simply started a container, it worked, but when I tried to integrate it into a more complex existing project, I ran into #8 (at least error message was the same about '0' being undefined) - I assumed that was something different and not related to the CJS change I was making.

@zfben
Copy link
Contributor

zfben commented Apr 16, 2024

I did test it, what bug did you find? In a really simple setup where I simply started a container, it worked, but when I tried to integrate it into a more complex existing project, I ran into #8 (at least error message was the same about '0' being undefined) - I assumed that was something different and not related to the CJS change I was making.

I created an example for the bug: https://github.com/zfben/pgmock/actions/runs/8698477123/job/23855517922

Not sure why it happens.

@lautis
Copy link

lautis commented Apr 24, 2024

The bug is present in Jest even if using ESM. It's coming from https://github.com/stackframe-projects/pgmock/blob/main/src/dependencies/libv86.js#L1497 – the a instanceof ArrayBuffer returns false even the passed argument is an array buffer. This is likely related to jestjs/jest#2549

@zfben
Copy link
Contributor

zfben commented Apr 26, 2024

@henrinormak @lautis I have fixed the cjs and jest issue in #14

N2D4 pushed a commit that referenced this pull request May 25, 2024
@N2D4
Copy link
Contributor

N2D4 commented May 25, 2024

Merged in #14!

@N2D4 N2D4 closed this May 25, 2024
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.

Will it support cjs?
4 participants