Open ueokande opened 4 years ago
Should be possible to directly bundle the json with typescript's resolveJsonModule
for just using the mock, and dynamically importing fs/path when updating - I'll look into that.
I'm curious, wouldn't it be possible to use the actual `browser' if the tests are already running in a real browser?
@stoically
Karma runs test scripts inside a tab. The scripts in the test cannot access the actual browser
.
To access the browser
object in the test, a custom test runner that allows tests to run on extensions namespace might be required (I'm not sure that is possible)
I cannot run tests with webextensions-api-mock on Karma since the update to v1.0.0. The karma outputs the following message:
Karma is a test runner to run code on real browsers and unable to load Node.js modules. The
fs
andpath
depend on Node.js and running code on Karma cannot load them. webextensions-api-mock has read and updated the local schema since v1.0.0.I tried to fix
index.ts
as the following:but still not works since
fs
andpath
modules are also used inupdate.ts
and webextensions-schema.Running tests on real browsers is necessary for me due to detecting the different behavior between browsers on the unit test.