mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-10-19 14:17:20 +02:00
fix: derive editor modes from shipped assets for ES2020 browsers
This commit is contained in:
1 parent
64ae393200
commit
45153886e3
6 files changed
+27
-24
No files matched your search
+3
-1
@@ -28,6 +28,8 @@ async function browser(route = "/", overrides = {}, storage = {}) {
|
||||
url: "http://localhost" + route, runScripts: "dangerously", pretendToBeVisual: true, virtualConsole,
|
||||
});
|
||||
const window = dom.window;
|
||||
// Exercise the production bundle on browsers without this ES2022 builtin.
|
||||
window.Object.hasOwn = undefined;
|
||||
window.matchMedia = () => ({ matches: false });
|
||||
window.HTMLCanvasElement.prototype.getContext = () => null;
|
||||
window.fetch = async (url, options = {}) => {
|
||||
@@ -380,7 +382,7 @@ describe("Vue 3 UI", function () {
|
||||
expect(ui.window.document.activeElement.id).to.equal("commit");
|
||||
});
|
||||
|
||||
for (const [file, mode] of [["data.csv", "text"], ["LICENSE", "text"], ["model.idp", "text"], ["hello.js", "javascript"]]) {
|
||||
for (const [file, mode] of [["data.csv", "text"], ["LICENSE", "text"], ["model.idp", "text"], ["hello.js", "javascript"], ...["csp", "applescript", "logtalk", "redshift", "sparql", "turtle"].map(mode => ["file." + mode, mode])]) {
|
||||
it("uses an available editor mode for " + file, async function () {
|
||||
ui = await browser("/r/test/" + file, {
|
||||
"/api/repo/test/files/": [{ name: file, path: "", sha: "1", size: 5 }],
|
||||
|
||||
Reference in new issue
Block a user