From 281af7b67d4520a357ba6eec62fb70d82d48c3da Mon Sep 17 00:00:00 2001 From: Charlike Mike Reagent Date: Mon, 30 Jul 2018 00:58:40 +0300 Subject: [PATCH] fix: meta tweaks and basic test Signed-off-by: Charlike Mike Reagent --- .verb.md | 2 +- README.md | 4 +++- _config.yml | 1 - docs/{README.md => API.md} | 2 +- docs/_config.yml | 1 - package.json | 10 ++++------ src/index.js | 2 +- test/index.js | 11 +++++++---- test/snapshots/index.snapshot.json | 2 +- 9 files changed, 18 insertions(+), 17 deletions(-) delete mode 100644 _config.yml rename docs/{README.md => API.md} (99%) delete mode 100644 docs/_config.yml diff --git a/.verb.md b/.verb.md index 2676f89..9818118 100644 --- a/.verb.md +++ b/.verb.md @@ -46,7 +46,7 @@ $ yarn add {%= name %} ``` ## API -{%= include('docs/README.md') %} +{%= include('docs/API.md') %} **[back to top](#thetop)** diff --git a/README.md b/README.md index f8f6146..9a790f4 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,8 @@ Project is [semantically](https://semver.org) & automatically released on [Circl - [Users](#users) - [License](#license) +_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_ + ## Install This project requires [**Node.js**](https://nodejs.org) **^8.9.0 || ^10.6.0**. Install it using [**yarn**](https://yarnpkg.com) or [**npm**](https://npmjs.com). _We highly recommend to use Yarn when you think to contribute to this project._ @@ -67,7 +69,7 @@ _Generated using [docks](http://npm.im/docks)._ ### [src/index.js](/src/index.js) #### [docks](/src/index.js#L47) -> Constructor that gives you methods. +Constructor that gives you methods. **Returns** - `Object` instance of `Docks` diff --git a/_config.yml b/_config.yml deleted file mode 100644 index c419263..0000000 --- a/_config.yml +++ /dev/null @@ -1 +0,0 @@ -theme: jekyll-theme-cayman \ No newline at end of file diff --git a/docs/README.md b/docs/API.md similarity index 99% rename from docs/README.md rename to docs/API.md index 5f36ae6..f414e51 100644 --- a/docs/README.md +++ b/docs/API.md @@ -4,7 +4,7 @@ _Generated using [docks](http://npm.im/docks)._ ### [src/index.js](/src/index.js) #### [docks](/src/index.js#L47) -> Constructor that gives you methods. +Constructor that gives you methods. **Returns** - `Object` instance of `Docks` diff --git a/docs/_config.yml b/docs/_config.yml deleted file mode 100644 index fc24e7a..0000000 --- a/docs/_config.yml +++ /dev/null @@ -1 +0,0 @@ -theme: jekyll-theme-hacker \ No newline at end of file diff --git a/package.json b/package.json index d642b4a..ef03000 100644 --- a/package.json +++ b/package.json @@ -4,11 +4,10 @@ "license": "Apache-2.0", "licenseStart": "2018", "scripts": { - "predocs": "yarn build", - "docs": "node dist/cli.js 'src/**/*' && verb", + "predocs": "rm -rf docs && yarn build", + "docs": "node dist/cli.js 'src/**/*' --outfile docs/API.md && verb", "lint": "eslint src test --fix --format codeframe", - "test": "asia -r esm -u", - "cov": "nyc --require esm asia", + "test": "nyc --require esm asia", "prebuild": "rm -rf dist && mkdir dist", "build": "ascjs src dist", "gitadd": "git status --porcelain && git add -A", @@ -85,8 +84,7 @@ "toc": { "render": true, "method": "preWrite", - "maxdepth": 4, - "footer": "" + "maxdepth": 4 }, "layout": "empty", "tasks": [ diff --git a/src/index.js b/src/index.js index ed14e6d..931107b 100644 --- a/src/index.js +++ b/src/index.js @@ -38,7 +38,7 @@ const DEFAULT_OPTIONS = { }; /** - * > Constructor that gives you methods. + * Constructor that gives you methods. * * @name docks * @returns {Object} instance of `Docks` diff --git a/test/index.js b/test/index.js index 00799aa..ace2c2f 100644 --- a/test/index.js +++ b/test/index.js @@ -1,10 +1,13 @@ +import path from 'path'; +import proc from 'process'; import test from 'asia'; import docks from '../src'; const app = docks(); -test('foo bar', (t) => { - const cmts = app.parse('str'); - console.log(cmts.length); - t.ok(true); +test('todo tests', async (t) => { + const filepath = path.join(proc.cwd(), 'src', 'plugins', 'render.js'); + const text = await app.renderFile(filepath); + // console.log(text) + t.ok(text); }); diff --git a/test/snapshots/index.snapshot.json b/test/snapshots/index.snapshot.json index f471877..ef4af3a 100644 --- a/test/snapshots/index.snapshot.json +++ b/test/snapshots/index.snapshot.json @@ -1 +1 @@ -{"foo bar":{"skip":false,"todo":false,"run":false,"isPending":false,"isRejected":false,"isFulfilled":true,"id":1,"str":"(t) => {\n const cmts = app.parse('str');\n _7cb‍.g.console.log(cmts.length);\n t.ok(true);\n}","title":"foo bar"}} \ No newline at end of file +{"todo tests":{"skip":false,"todo":false,"run":false,"isPending":false,"isRejected":false,"isFulfilled":true,"id":1,"str":"async (t) => {\n const filepath = path.join(proc.cwd(), 'src', 'plugins', 'render.js');\n const text = await app.renderFile(filepath);\n // console.log(text)\n t.ok(text);\n}","title":"todo tests"}} \ No newline at end of file