Skip to content

Conversation

@sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Jan 12, 2026

This test I believe is the only one where we have custom JS library function that user asyncify. Its useful to be able to this these tests outside the browser too.

@sbc100 sbc100 requested a review from brendandahl January 12, 2026 22:15
This test I believe is the only one where we have custom JS library
function that user asyncify.  Its useful to be able to this these tests
outside the browser too.
'nothing': (['-DBAD'],), # noqa
'empty_list': (['-DBAD', '-sASYNCIFY_IMPORTS=[]'],), # noqa
'em_js_bad': (['-DBAD', '-DUSE_EM_JS'],), # noqa
})
Copy link
Member

Choose a reason for hiding this comment

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

This is a bunch of duplicated code with test_browser. Maybe we can just test this outside of the browser in the other file? That is, right after self.btest there, we can add self.do_runf?

Or, perhaps we can find a nice way to share such logic between browser and non-browser?

Copy link
Member

Choose a reason for hiding this comment

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

(Specifically, I worry that we update one test over time, improving it, but forget to update the other version in the other file)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I share this concern, but also this is not a new things. We have many quite a few tests that are run both in browserpy and in other.py or core.py.

I agree it would be nice to have better way to express this duplication.

Also, how do we decide which tests should run in the browser at all? This test, for example, is not testing anything browser specific? Does that mean we should not run it under the browser?

Perhaps we should allow certain tests in test_other.py and test_core.py to be tagged as "@also_run_in_browser" ? Or perhaps we should run all other.py or core.py tests in the browser in certain CI configs.

All of this sounds quick complicated though...

My general feeling is if a test can run outside the browser then there should be a way to run it outside the browser. We have have a way to run browser tests using --browser=node.. maybe we should push more on that option?

I'll leave this PR as a draft for now.

Copy link
Member

Choose a reason for hiding this comment

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

I like the idea to lean on --browser=node more. maybe a decorator could make a browser test also run in that mode, something like that - hopefully that is simple?

@sbc100 sbc100 marked this pull request as draft January 13, 2026 18:18
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