diff --git a/package.json b/package.json index 9569b472..22f81c7c 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "coverage": "yarn add coveralls@2 && nyc report --reporter=text-lcov | coveralls" }, "dependencies": { - "argparse": "~0.1.15", + "argparse": "^1.0.10", "autolinker": "~0.28.0" }, "devDependencies": { diff --git a/test/cli.js b/test/cli.js new file mode 100644 index 00000000..a35b1cf9 --- /dev/null +++ b/test/cli.js @@ -0,0 +1,25 @@ +const ChildProcess = require("child_process") +var assert = require('assert'); + +// placed here to make multiline indentation easier, feel free to move if you're +// adding more tests here +const desiredOutput = `
++It’s really just here to make sure the Remarkable CLI can take a Markdown +document as an input
+
It’s not comprehensive or anything
+Hopefully the CLI can handle it though
+` + +describe("Remarkable CLI", function() { + it("simple Markdown file as input", function() { + const output = ChildProcess.execSync( + "../bin/remarkable.js ./fixtures/cli-input.md", + { + cwd: __dirname + } + ) + assert.strictEqual(output.toString(), desiredOutput) + }) +}) diff --git a/test/fixtures/cli-input.md b/test/fixtures/cli-input.md new file mode 100644 index 00000000..6489ad4e --- /dev/null +++ b/test/fixtures/cli-input.md @@ -0,0 +1,8 @@ +### This is a simple Markdown document + +> It's really just here to make sure the Remarkable CLI can take a Markdown +> document as an input + +**It's not comprehensive or anything** + +Hopefully the CLI can handle it though diff --git a/yarn.lock b/yarn.lock index c84ccd74..620d0c9c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -156,7 +156,7 @@ archy@^1.0.0: resolved "https://registry.yarnpkg.com/archy/-/archy-1.0.0.tgz#f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40" integrity sha1-+cjBN1fMHde8N5rHeyxipcKGjEA= -argparse@^1.0.7: +argparse@^1.0.10, argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==