mirror of
https://github.com/changesets/action
synced 2026-10-26 16:39:56 +08:00
Sort things by public/private
This commit is contained in:
+27
-1
@@ -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();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user