Sort things by public/private

This commit is contained in:
mitchellhamilton
2019-09-17 12:43:32 +10:00
parent 902339ecb3
commit 564f71feba
5 changed files with 70 additions and 5 deletions
+27 -1
View File
@@ -1,4 +1,9 @@
import { getChangelogEntry, BumpLevels, getChangedPackages } from "./utils";
import {
getChangelogEntry,
BumpLevels,
getChangedPackages,
sortTheThings
} from "./utils";
import tempy from "tempy";
import { exec } from "@actions/exec";
import * as fs from "fs-extra";
@@ -106,3 +111,24 @@ test("getChangedPackages works", async () => {
{ name: "some-package", dir, config: workspace }
]);
});
test("it sorts the things right", () => {
let things = [
{
name: "a",
highestLevel: BumpLevels.major,
private: true
},
{
name: "b",
highestLevel: BumpLevels.patch,
private: false
},
{
name: "c",
highestLevel: BumpLevels.major,
private: false
}
];
expect(things.sort(sortTheThings)).toMatchSnapshot();
});