* Install jest * Configure jest script * Fix eslintrc * Add @types/jest * Add test for validate-new-version * Fix eslintrc * Add workflow file * Add node version * cd to script/release * Fix workflow file * Fix version * Ignore from root * Update yarn.lock * Set defaults.run.working-directory
16 lines
517 B
JavaScript
16 lines
517 B
JavaScript
import chalk from "chalk";
|
|
import step from "../../steps/validate-new-version.js";
|
|
|
|
describe("validate-new-version", () => {
|
|
it("throws error for invalid semver", () => {
|
|
expect(() => {
|
|
step({ version: "foo" });
|
|
}).toThrow("Invalid version specified");
|
|
});
|
|
it("throws error when version isn't greater than prev version", () => {
|
|
expect(() => {
|
|
step({ version: "0.0.1", previousVersion: "0.0.2" });
|
|
}).toThrow(`Version ${chalk.yellow("0.0.1")} has already been published`);
|
|
});
|
|
});
|