Skip to content

Commit

Permalink
test: ensure we only test against 2.0.0...2.0.1
Browse files Browse the repository at this point in the history
Signed-off-by: Logan McAnsh <[email protected]>
  • Loading branch information
mcansh committed Sep 21, 2023
1 parent b96f29b commit 13f2318
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions __tests__/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,29 @@ beforeAll(() => {
execaSync("git", fetchArgs, execaOptions);
cwd = process.cwd();
process.chdir(TMP_DIR);

let currentDate = new Date("2023-09-21T23:31:48.180Z");

// remove tags prior to 2.0.1
let tagsToRemove = execaSync("git", [
"tag",
"-l",
"--sort",
"-creatordate",
"--format",
"%(refname:strip=2) %(taggerdate)",
])
.stdout.split("\n")
.filter((line) => {
let [, tagTag] = line.split(" ");
let date = new Date(tagTag);
return date < currentDate;
});

for (let tag of tagsToRemove) {
console.log(`removing tag ${tag}`);
execaSync("git", ["tag", "-d", tag]);
}
});

afterAll(() => {
Expand Down

0 comments on commit 13f2318

Please sign in to comment.