Skip to content

Conversation

asturur
Copy link
Member

@asturur asturur commented Apr 20, 2025

Description

Migrate more tests to vitests

Copy link

codesandbox bot commented Apr 20, 2025

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Copy link
Contributor

Build Stats

file / KB (diff) bundled minified
fabric 913.863 (0) 301.232 (0)


describe('env', () => {
afterEach(() => {
delete global.window;
Copy link
Contributor

Choose a reason for hiding this comment

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

i think we should use globalThis rather than global because it has interop between browser and node
Probably doesnt matter for this test because I assume this test will not run in the browser in the future?
But just to get used to globalThis over global

Copy link
Member Author

Choose a reason for hiding this comment

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

yes i think yes, this global interaction i also think it broke several things

@asturur
Copy link
Member Author

asturur commented Apr 20, 2025

I m not sure the env test with imports and requires make sense

@Smrtnyk
Copy link
Contributor

Smrtnyk commented Apr 20, 2025

I m not sure the env test with imports and requires make sense

Maybe thinga are off because it goes through vite-node resolution and not native node resolution

@Smrtnyk
Copy link
Contributor

Smrtnyk commented Apr 20, 2025

Maybe this test should be done on compiled dist from e2e?

@asturur
Copy link
Member Author

asturur commented Apr 20, 2025

Maybe this test should be done on compiled dist from e2e?

Or maybe there isn't much to test. Probably a single one off kind of test is fine but is not a priority.

Copy link
Contributor

github-actions bot commented Apr 20, 2025


> fabric@6.6.2 coverage:report:ci
> nyc report --reporter=text-summary


=============================== Coverage summary ===============================
Statements   : 77.36% ( 17791/22997 )
Branches     : 87.51% ( 3889/4444 )
Functions    : 86.3% ( 1367/1584 )
Lines        : 77.36% ( 17791/22997 )
================================================================================

@Smrtnyk
Copy link
Contributor

Smrtnyk commented Apr 20, 2025

Maybe this test should be done on compiled dist from e2e?

Or maybe there isn't much to test. Probably a single one off kind of test is fine but is not a priority.

That is why i left it for the end, didnt want to fry up my brain straight at the beginning

@asturur
Copy link
Member Author

asturur commented Apr 20, 2025

Maybe this test should be done on compiled dist from e2e?

Or maybe there isn't much to test. Probably a single one off kind of test is fine but is not a priority.

That is why i left it for the end, didnt want to fry up my brain straight at the beginning

I didn't expect it to be so annoying. I was like, look a short test a quick win.

@Smrtnyk
Copy link
Contributor

Smrtnyk commented Apr 20, 2025

Maybe this test should be done on compiled dist from e2e?

Or maybe there isn't much to test. Probably a single one off kind of test is fine but is not a priority.

That is why i left it for the end, didnt want to fry up my brain straight at the beginning

I didn't expect it to be so annoying. I was like, look a short test a quick win.

Haha yeah, thought the same
But then I realised all imports resolution now goes through vitest and that this needs to be tested differently

@asturur asturur merged commit 118f421 into master Apr 20, 2025
20 checks passed
@asturur asturur deleted the migrate-more branch April 20, 2025 10:25
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