Improve a test

This commit is contained in:
mitchellhamilton
2019-09-16 18:38:06 +10:00
parent c3c3ae189a
commit 902339ecb3
+2
View File
@@ -90,6 +90,7 @@ test("getChangedPackages works", async () => {
name: "some-package", name: "some-package",
version: "1.0.0" version: "1.0.0"
}); });
await fs.writeFile(path.join(dir, "CHANGELOG.md"), "some content");
await exec("git", ["add", "."], { cwd: dir }); await exec("git", ["add", "."], { cwd: dir });
await exec("git", ["commit", "-m", "initial commit"], { cwd: dir }); await exec("git", ["commit", "-m", "initial commit"], { cwd: dir });
let emptyWorkspaces = await getChangedPackages(dir); let emptyWorkspaces = await getChangedPackages(dir);
@@ -98,6 +99,7 @@ test("getChangedPackages works", async () => {
name: "some-package", name: "some-package",
version: "2.0.0" version: "2.0.0"
}; };
await fs.writeFile(path.join(dir, "CHANGELOG.md"), "other content");
await fs.writeJson(path.join(dir, "package.json"), workspace); await fs.writeJson(path.join(dir, "package.json"), workspace);
let workspaces = await getChangedPackages(dir); let workspaces = await getChangedPackages(dir);
expect(workspaces).toEqual([ expect(workspaces).toEqual([