Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URL updates #65

Closed
wants to merge 21 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix tests
  • Loading branch information
gbooth27 committed Oct 18, 2022
commit 7f10efd00eb9d663c89aa1323b6bb4a7fbe8f400
786 changes: 767 additions & 19 deletions dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions test/specs/action/failure.spec.js
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ describe("GitHub Action - failure tests", () => {
});

expect(cli).to.have.stderr("");
expect(cli).stdout.to.include("::error::TypeError [ERR_INVALID_URL] [ERR_INVALID_URL]: Invalid URL: example.com");
expect(cli).stdout.to.include("::error::TypeError [ERR_INVALID_URL]:");
expect(cli).to.have.exitCode(1);

files.assert.doesNotExist("home/.npmrc");
@@ -236,7 +236,7 @@ describe("GitHub Action - failure tests", () => {
});

expect(cli).to.have.stderr("BOOM!");
expect(cli).stdout.to.include("::error::Error: Unable to publish my-lib v2.0.0 to NPM.");
expect(cli).stdout.to.include("::error::Error: Unable to publish my-lib v2.0.0 to https://registry.npmjs.org/.");
expect(cli).stdout.to.include("npm publish exited with a status of 1");
expect(cli).stdout.not.to.include("BOOM!");
expect(cli).to.have.exitCode(1);
182 changes: 91 additions & 91 deletions test/specs/action/success.spec.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion test/specs/cli/args.spec.js
Original file line number Diff line number Diff line change
@@ -132,7 +132,8 @@ describe("CLI - argument tests", () => {
let cli = exec.cli("--registry", "example.com");

expect(cli).to.have.stdout("");
expect(cli).stderr.to.include("Invalid URL: example.com");
console.log(cli.stderr);
expect(cli).stderr.to.include("Invalid URL\n");
expect(cli).to.have.exitCode(1);

files.assert.doesNotExist("home/.npmrc");
2 changes: 1 addition & 1 deletion test/specs/cli/failure.spec.js
Original file line number Diff line number Diff line change
@@ -167,7 +167,7 @@ describe("CLI - failure tests", () => {
let cli = exec.cli();

expect(cli).to.have.stdout("");
expect(cli).stderr.to.include("Unable to publish my-lib v2.0.0 to NPM.");
expect(cli).stderr.to.include("Unable to publish my-lib v2.0.0 ");
expect(cli).stderr.to.include("npm publish exited with a status of 1");
expect(cli).stderr.to.include("BOOM!");
expect(cli).to.have.exitCode(1);
27 changes: 13 additions & 14 deletions test/specs/cli/success.spec.js
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@ describe("CLI - success tests", () => {

expect(cli).to.have.stderr("");
expect(cli).stdout.to.include("my-lib 2.0.0");
expect(cli).stdout.to.include("Successfully published my-lib v2.0.0 to NPM");
expect(cli).stdout.to.include("Successfully published my-lib v2.0.0 to");
expect(cli).to.have.exitCode(0);

files.assert.contents("home/.npmrc",
@@ -78,10 +78,9 @@ describe("CLI - success tests", () => {
});

let cli = exec.cli();

expect(cli).to.have.stderr("");
expect(cli).stdout.to.include("my-lib 1.0.0");
expect(cli).stdout.to.include("Successfully published my-lib v1.0.0 to NPM");
expect(cli).stdout.to.include("Successfully published my-lib v1.0.0 to");
expect(cli).to.have.exitCode(0);

files.assert.contents("home/.npmrc",
@@ -121,7 +120,7 @@ describe("CLI - success tests", () => {

expect(cli).to.have.stderr("");
expect(cli).stdout.to.include("my-lib 1.0.0");
expect(cli).stdout.to.include("Successfully published my-lib v1.0.0 to NPM");
expect(cli).stdout.to.include("Successfully published my-lib v1.0.0 to");
expect(cli).to.have.exitCode(0);

files.assert.contents("home/.npmrc",
@@ -148,9 +147,9 @@ describe("CLI - success tests", () => {
});

let cli = exec.cli();

console.log(cli.stdout);
expect(cli).to.have.stderr("");
expect(cli).stdout.to.include("📦 my-lib v1.0.0 is already published to NPM");
expect(cli).stdout.to.include("📦 my-lib v1.0.0 is already published to");
expect(cli).to.have.exitCode(0);

files.assert.contents("home/.npmrc",
@@ -191,7 +190,7 @@ describe("CLI - success tests", () => {

expect(cli).to.have.stderr("");
expect(cli).stdout.to.include("my-lib 2.0.0");
expect(cli).stdout.to.include("Successfully published my-lib v2.0.0 to NPM");
expect(cli).stdout.to.include("Successfully published my-lib v2.0.0 to");
expect(cli).to.have.exitCode(0);

files.assert.contents("home/.npmrc",
@@ -232,7 +231,7 @@ describe("CLI - success tests", () => {

expect(cli).to.have.stderr("");
expect(cli).stdout.to.include("my-lib 1.1.0");
expect(cli).stdout.to.include("📦 Successfully published my-lib v1.1.0 to NPM");
expect(cli).stdout.to.include("📦 Successfully published my-lib v1.1.0 to");
expect(cli).to.have.exitCode(0);

files.assert.contents("home/.npmrc",
@@ -289,7 +288,7 @@ describe("CLI - success tests", () => {

expect(cli).to.have.stderr("");
expect(cli).stdout.to.include("my-lib 1.0.1");
expect(cli).stdout.to.include("📦 Successfully published my-lib v1.0.1 to NPM");
expect(cli).stdout.to.include("📦 Successfully published my-lib v1.0.1 to ");
expect(cli).to.have.exitCode(0);

files.assert.contents("home/.npmrc",
@@ -337,7 +336,7 @@ describe("CLI - success tests", () => {

expect(cli).to.have.stderr("");
expect(cli).stdout.to.include("my-lib 1.0.0-beta");
expect(cli).stdout.to.include("📦 Successfully published my-lib v1.0.0-beta to NPM");
expect(cli).stdout.to.include("📦 Successfully published my-lib v1.0.0-beta to ");
expect(cli).to.have.exitCode(0);

files.assert.contents("home/.npmrc",
@@ -377,7 +376,7 @@ describe("CLI - success tests", () => {

expect(cli).to.have.stderr("");
expect(cli).stdout.to.include("@my-scope/my-lib 2.0.0");
expect(cli).stdout.to.include("Successfully published @my-scope/my-lib v2.0.0 to NPM");
expect(cli).stdout.to.include("Successfully published @my-scope/my-lib v2.0.0 to");
expect(cli).to.have.exitCode(0);

files.assert.contents("home/.npmrc",
@@ -417,7 +416,7 @@ describe("CLI - success tests", () => {

expect(cli).to.have.stderr("");
expect(cli).stdout.to.include("my-lib 2.0.0");
expect(cli).stdout.to.include("Successfully published my-lib v2.0.0 to NPM");
expect(cli).stdout.to.include("Successfully published my-lib v2.0.0 to");
expect(cli).to.have.exitCode(0);

files.assert.contents("home/.npmrc",
@@ -457,7 +456,7 @@ describe("CLI - success tests", () => {

expect(cli).to.have.stderr("");
expect(cli).stdout.to.include("@my-scope/my-lib 2.0.0");
expect(cli).stdout.to.include("Successfully published @my-scope/my-lib v2.0.0 to NPM");
expect(cli).stdout.to.include("Successfully published @my-scope/my-lib v2.0.0 to");
expect(cli).to.have.exitCode(0);

files.assert.contents("home/.npmrc",
@@ -497,7 +496,7 @@ describe("CLI - success tests", () => {

expect(cli).to.have.stderr("");
expect(cli).stdout.to.include("my-lib 1.1.0");
expect(cli).stdout.to.include("📦 my-lib v1.1.0 was NOT actually published to NPM (dry run)");
expect(cli).stdout.to.include("📦 my-lib v1.1.0 was NOT actually published to ");
expect(cli).to.have.exitCode(0);

npm.assert.ran(4);
4 changes: 2 additions & 2 deletions test/specs/lib/failure.spec.js
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@ describe("NPM package - failure tests", () => {
}
catch (error) {
expect(error).to.be.an.instanceOf(TypeError);
expect(error.message).to.equal("Invalid URL: example.com");
expect(error.message).to.equal("Invalid URL");
}

files.assert.doesNotExist("home/.npmrc");
@@ -222,7 +222,7 @@ describe("NPM package - failure tests", () => {
catch (error) {
expect(error).to.be.an.instanceOf(Error);
expect(error.message).to.equal(
"Unable to publish my-lib v2.0.0 to NPM. \n" +
"Unable to publish my-lib v2.0.0 to https://registry.npmjs.org/. \n" +
"npm publish exited with a status of 1.\n\n" +
"BOOM!"
);