diff --git a/source/server/integration.test.ts b/source/server/integration.test.ts index be47a7f3..d03d06fe 100644 --- a/source/server/integration.test.ts +++ b/source/server/integration.test.ts @@ -76,6 +76,7 @@ describe("Web Server Integration", function(){ let r = await this.agent.post("/api/v1/scenes/bar") .set("Content-Type", "application/octet-stream") .send(content) + .expect(201); let res = await this.agent.get("/scenes/bar/models/bar.glb").expect(200); expect(res.text.slice(0,4).toString()).to.equal("glTF"); expect(res.text.length).to.equal(content.length); diff --git a/source/server/routes/api/v1/scenes/scene/post.ts b/source/server/routes/api/v1/scenes/scene/post.ts index abfdd85c..47f92fd1 100644 --- a/source/server/routes/api/v1/scenes/scene/post.ts +++ b/source/server/routes/api/v1/scenes/scene/post.ts @@ -12,7 +12,7 @@ import { parse_glb } from "../../../../../utils/glTF.js"; * @returns */ async function getDocument(scene:string, filepath:string){ - let {default:orig} = await import("../../../../../utils/schema/default.svx.json"); + let {default:orig} = await import("../../../../../utils/schema/default.svx.json", {assert:{type:"json"}}); //dumb inefficient Deep copy because we want to mutate the doc in-place let document = JSON.parse(JSON.stringify(orig)); let meta = await parse_glb(filepath);