jasmine / jasmine-npm

A jasmine runner for node projects.
MIT License
376 stars 145 forks source link

Fixed support for namespaced modules. Closes #199 #209

Closed jan-molak closed 1 year ago

jan-molak commented 1 year ago

Serenity/JS provides a Jasmine adapter published as a namespaced module @serenity-js/jasmine.

This change adds support for Jasmine loader.js to load namespaced modules and closes #199.

jan-molak commented 1 year ago

@sgravrock looks like Windows tests use OS-dependent paths. Let me know how you'd like to proceed, please.

sgravrock commented 1 year ago

I can think of a few options:

jan-molak commented 1 year ago

Thanks for the feedback, @sgravrock! I played around with the regex, but it seems like repeating url.pathToFileURL in the test as well might be easier to read:

expect(importShim).toHaveBeenCalledWith(url.pathToFileURL('/the/path/to/the/module').toString());

If you prefer a regex please let me know and I can update the PR.

sgravrock commented 1 year ago

Thanks for the PR.