Make workspace authoring transitions and typed invocation coherent
This commit is contained in:
@@ -55,6 +55,12 @@ test("package/function/migration scaffolds register implementations and refresh
|
||||
await execFile("nix-instantiate", ["--parse", path.join(packageRoot, "flake.nix")]);
|
||||
}
|
||||
await assert.rejects(() => apply("function", {...base, name: "play", id: "export:play"}), /unique/);
|
||||
const declarations = path.join(root, base.directory, "package.qx");
|
||||
await fs.writeFile(declarations, (await fs.readFile(declarations, "utf8")).replace(/}\s*$/, ' function authored id "export:authored" : unit -> unit;\n}\n'));
|
||||
await apply("refresh", base);
|
||||
assert.match(await fs.readFile(path.join(root, base.directory, "src/server.ts"), "utf8"), /"authored":/);
|
||||
assert.match(await fs.readFile(path.join(root, base.directory, "src/impl/authored.ts"), "utf8"), /Implement authored/);
|
||||
assert.equal(await fs.readFile(filename, "utf8"), edited);
|
||||
await assert.rejects(() => planStructure(root, {kind: "package", source, resourceRoot: base.directory, validation: "syntax", files: [{
|
||||
file: `${base.directory}/package.qx`, edits: [{operation: "replace", target: {kind: "packageResourceDecl", id: "package:chess"},
|
||||
source: 'package Other id "package:other" revision "package:other@1" {}'}],
|
||||
|
||||
Reference in New Issue
Block a user