diff --git a/packages/cli/__tests__/__snapshots__/bundle.test.ts.snap b/packages/cli/__tests__/__snapshots__/bundle.test.ts.snap new file mode 100644 index 000000000..c2cdb0485 --- /dev/null +++ b/packages/cli/__tests__/__snapshots__/bundle.test.ts.snap @@ -0,0 +1,30 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`bundle should function 1`] = ` +" +create-labels + + Create your project's labels on github. If labels exist it will update them. + +Options + + -d, --dry-run Report what command will do but do not actually do anything + +Global Options + + -V, --version Display auto's version + -v, --verbose Show some more logs. Pass -vv for very verbose logs. + --repo string The repo to set the status on. Defaults to looking in + the package definition for the platform + --owner string The owner of the GitHub repo. Defaults to reading from + the package definition for the platform + --github-api string GitHub API to use + --plugins string[] Plugins to load auto with. (defaults to just npm) + -h, --help Display the help output + +Examples + + $ auto create-labels + +" +`; diff --git a/packages/cli/__tests__/bundle.test.ts b/packages/cli/__tests__/bundle.test.ts new file mode 100644 index 000000000..71f1cea75 --- /dev/null +++ b/packages/cli/__tests__/bundle.test.ts @@ -0,0 +1,23 @@ +import path from "path"; +import { execSync } from "child_process"; + +test("bundle should function", () => { + const type = + (process.platform === "win32" && "win.exe") || + (process.platform === "darwin" && "macos") || + "linux"; + const zip = path.join(__dirname, `../binary/auto-${type}`); + const binary = path.join(__dirname, "../auto"); + + execSync(`gunzip -c ${zip} > ${binary}`); + execSync(`chmod +x ${binary}`); + + expect( + // Using this command because it is unlikely to change very much + execSync(`${binary} create-labels --help`, { + encoding: "utf8", + }) + ).toMatchSnapshot(); + + execSync(`rm ${binary}`); +});