You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current unit test approach relies on loading HTML files dynamically and updating the jQuery context. Loading the HTML file results in a GET request with the file protocol. Well, it seems both Firefox and Chrome's CORS (Cross-Origin Resource Sharing) policies are stricter.
Access to XMLHttpRequest at 'file:///.../SigTools/src/test/pages/datatables/single_row.html' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https.
I think the error message is quite clear. The easiest solution, I can think of, is to launch a small server on development mode that serves the test HTML files. However, the server must also add the header Access-Control-Allow-Origin: * to all responses.
Launch a local web server on /src/test, with a fixed port (customizable env environment is a bonus). Since with already have node, perhaps is the easiest way to create the said server
Ensure the web server attaches Access-Control-Allow-Origin: * on all responses
Add a prefix with the address for the local web server on all requested HTML files. Update it here:
Just lost 15 minutes because the browser was caching the test HTML file... if we implement the web server, I believe there is a header in the response to tell browsers "do not cache this resource"! Might be useful
The current unit test approach relies on loading HTML files dynamically and updating the jQuery context. Loading the HTML file results in a GET request with the
file
protocol. Well, it seems both Firefox and Chrome's CORS (Cross-Origin Resource Sharing) policies are stricter.I think the error message is quite clear. The easiest solution, I can think of, is to launch a small server on development mode that serves the test HTML files. However, the server must also add the header
Access-Control-Allow-Origin: *
to all responses./src/test
, with a fixed port (customizable env environment is a bonus). Since with already have node, perhaps is the easiest way to create the said serverAccess-Control-Allow-Origin: *
on all responsesSigTools/src/test/setup.js
Line 5 in 533ebb7
I think this is enough!
The text was updated successfully, but these errors were encountered: