Skip to content
This repository has been archived by the owner on Jul 10, 2019. It is now read-only.

Commit

Permalink
fix(tests): add tests for 100% coverage
Browse files Browse the repository at this point in the history
TAG: latest
  • Loading branch information
tunnckoCore committed Jul 18, 2017
1 parent 2b66504 commit 20c1ca1
Show file tree
Hide file tree
Showing 17 changed files with 3,498 additions and 6 deletions.
4 changes: 4 additions & 0 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const getCharlikeVersion = () => {

updateNotifier({ pkg: pkg }).notify()

/* istanbul ignore next */
process.title = pkg.bin ? Object.keys(pkg.bin)[0] : pkg.name

const name = cli._[0] || cli.name
Expand Down Expand Up @@ -100,7 +101,10 @@ charlike(name, desc, options)
console.log(`Project "${name}" scaffolded to "${dest}"`)
})
.catch((err) => {
/* istanbul ignore next */
console.error(`Sorry, some error occured!`)
/* istanbul ignore next */
console.error(`ERROR: ${err.message}`)
/* istanbul ignore next */
process.exit(1) // eslint-disable-line no-process-exit
})
12 changes: 12 additions & 0 deletions foo-quxie/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
insert_final_newline = false
29 changes: 29 additions & 0 deletions foo-quxie/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"extends": "standard",
"rules": {
"generator-star-spacing": ["error", { "before": true, "after": true }],
"computed-property-spacing": ["error", "never"],
"object-curly-spacing": ["error", "always"],
"space-before-function-paren": ["error", "always"],
"arrow-parens": ["error", "always"],
"max-params": "error",
"max-nested-callbacks": [
"error",
{
"max": 5
}
],
"max-depth": [
"error",
{
"max": 5
}
],
"no-empty": [
"error",
{
"allowEmptyCatch": true
}
]
}
}
70 changes: 70 additions & 0 deletions foo-quxie/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Always-ignore dirs #
# ####################
_gh_pages
node_modules
jspm_packages
bower_components
components
vendor
build
dest
lib-cov
coverage
nbproject
cache
temp
tmp
foo-quxie

# Packages #
# ##########
*.7z
*.dmg
*.iso
*.jar
*.rar
*.tar
*.zip

# OS, Logs and databases #
# #########################
logs
*.pid
*.dat
*.log
*.sql
*.sqlite
*~
~*

# Another files #
# ###############
Icon?
.DS_Store*
Thumbs.db
ehthumbs.db
Desktop.ini
npm-debug.log
.directory
._*
lcov.info

# Runtime data
pids
*.pid
*.seed
*.pid.lock


# nyc test coverage
.nyc_output

# Grunt intermediate storage
# see here: http://gruntjs.com/creating-plugins#storing-task-files
.grunt

# Optional npm cache directory
.npm

# Optional REPL history
.node_repl_history
210 changes: 210 additions & 0 deletions foo-quxie/.verb.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
# {%= name %} [![npm version][npmv-img]][npmv-url] [![github tags][ghtag-img]][ghtag-url] [![mit license][license-img]][license-url]

> {%= description %}
{%= include('highlight') %}

## Quality 👌

> By using [commitizen][czfriendly-url] and [conventional commit messages][conventional-messages-url],
maintaining meaningful [ChangeLog][changelogmd-url]
and commit history based on [global conventions][conventions-url],
following [StandardJS][standard-url] code style through [ESLint][eslint-url] and
having always up-to-date dependencies through integrations
like [GreenKeeper][gk-integration-url] and [David-DM][daviddm-url] service,
this package has top quality.

[![code climate][codeclimate-img]][codeclimate-url]
[![code style][standard-img]][standard-url]
[![commitizen friendly][czfriendly-img]][czfriendly-url]
[![greenkeeper friendly][gkfriendly-img]][gkfriendly-url]
[![dependencies][daviddm-deps-img]][daviddm-deps-url]
<!-- uncomment when need -->
<!-- [![develop deps][daviddm-devdeps-img]][daviddm-devdeps-url] -->

## Stability 💯

> By following [Semantic Versioning][semver-url] through [standard-version][] releasing tool,
this package is very stable and its tests are passing both on [Windows (AppVeyor)][appveyor-ci-url]
and [Linux (CircleCI)][circle-ci-url] with results
from 100% to [400%][absolute-coverage-url] test coverage, reported respectively
by [CodeCov][codecov-coverage-url] and [nyc (istanbul)][nyc-istanbul-url].

[![following semver][following-semver-img]][following-semver-url]
[![semantic releases][strelease-img]][strelease-url]
[![linux build][circle-img]][circle-url]
[![windows build][appveyor-img]][appveyor-url]
[![code coverage][codecov-img]][codecov-url]
[![nyc coverage][istanbulcov-img]][istanbulcov-url]

## Support :clap:

> If you have any problems, consider opening [an issue][open-issue-url],
ping me on twitter ([@tunnckoCore][tunnckocore-twitter-url]),
join the [support chat][supportchat-url] room
or queue a [live session][codementor-url] on CodeMentor with me.
If you don't have any problems, you're using it somewhere or
you just enjoy this product, then please consider [support me][paypalme-url] at PayPal,
since this is [OPEN Open Source][opensource-project-url] project made
with love at [Sofia, Bulgaria][bulgaria-url] 🇧🇬.

[![tunnckoCore support][supportchat-img]][supportchat-url]
[![tunnckoCore slack][slackchat-img]][slackchat-url]
[![code mentor][codementor-img]][codementor-url]
[![paypal donate][paypalme-img]][paypalme-url]
{%= badge('downloads') %}
[![npm total downloads][downloads-img]][downloads-url]

## Table of Contents
<!-- toc -->

## Install
Install with [npm](https://www.npmjs.com/)

```
$ npm install {%= name %} --save
```

or install using [yarn](https://yarnpkg.com)

```
$ yarn add {%= name %}
```

## Usage
> For more use-cases see the [tests](test.js)
```js
const {%= varname %} = require('{%= name %}')
```

## API
{%= apidocs('index.js') %}

{% if (verb.related && verb.related.list && verb.related.list.length) { %}
## Related
{%= related(verb.related.list, {words: 20}) %}
{% } %}

## Contributing
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue][open-issue-url].
Please read the [contributing guidelines][contributing-url] for advice on opening issues, pull requests, and coding standards.
If you need some help and can spent some cash, feel free to [contact me at CodeMentor.io][codementor-url] too.

**In short:** If you want to contribute to that project, please follow these things

1. Please DO NOT edit [README.md](README.md), [CHANGELOG.md][changelogmd-url] and [.verb.md](.verb.md) files. See ["Building docs"](#building-docs) section.
2. Ensure anything is okey by installing the dependencies and run the tests. See ["Running tests"](#running-tests) section.
3. Always use `npm run commit` to commit changes instead of `git commit`, because it is interactive and user-friendly. It uses [commitizen][] behind the scenes, which follows Conventional Changelog idealogy.
4. Do NOT bump the version in package.json. For that we use `npm run release`, which is [standard-version][] and follows Conventional Changelog idealogy.

Thanks a lot! :)

## Building docs
Documentation and that readme is generated using [verb-generate-readme][], which is a [verb][] generator, so you need to install both of them and then run `verb` command like that

```
$ npm install verbose/verb#dev verb-generate-readme --global && verb
```

_Please don't edit the README directly. Any changes to the readme must be made in [.verb.md](.verb.md)._

## Running tests
Clone repository and run the following in that cloned directory

```
$ npm install && npm test
```

## Author
{%= includeEither('authors', 'author') %}
+ [codementor/tunnckoCore](https://codementor.io/tunnckoCore)

## License
{%= copyright({ start: 2017, linkify: true, prefix: 'Copyright', symbol: '©' }) %} {%= licenseStatement %}

***

{%= include('footer') %}
_Project scaffolded using [charlike][] cli._

{%= reflinks(verb.reflinks) %}

[license-url]: https://github.com/{%= repository %}/blob/master/LICENSE
[license-img]: https://img.shields.io/npm/l/{%= name %}.svg

[downloads-url]: https://www.npmjs.com/package/{%= name %}
[downloads-img]: https://img.shields.io/npm/dt/{%= name %}.svg

[codeclimate-url]: https://codeclimate.com/github/{%= repository %}
[codeclimate-img]: https://img.shields.io/codeclimate/github/{%= repository %}.svg

[circle-url]: https://circleci.com/gh/{%= repository %}
[circle-img]: https://img.shields.io/circleci/project/github/{%= repository %}/master.svg?label=linux

[appveyor-url]: https://ci.appveyor.com/project/tunnckoCore/{%= name %}
[appveyor-img]: https://img.shields.io/appveyor/ci/tunnckoCore/{%= name %}/master.svg?label=windows

[codecov-url]: https://codecov.io/gh/{%= repository %}
[codecov-img]: https://img.shields.io/codecov/c/github/{%= repository %}/master.svg?label=codecov

[daviddm-deps-url]: https://david-dm.org/{%= repository %}
[daviddm-deps-img]: https://img.shields.io/david/{%= repository %}.svg

[daviddm-devdeps-url]: https://david-dm.org/{%= repository %}?type=dev
[daviddm-devdeps-img]: https://img.shields.io/david/dev/{%= repository %}.svg

[ghtag-url]: https://github.com/{%= repository %}/tags
[ghtag-img]: https://img.shields.io/github/tag/{%= repository %}.svg?label=github%20tag

[npmv-url]: https://www.npmjs.com/package/{%= name %}
[npmv-img]: https://img.shields.io/npm/v/{%= name %}.svg?label=npm%20version

[standard-url]: https://github.com/feross/standard
[standard-img]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg

[paypalme-url]: https://www.paypal.me/tunnckoCore/5usd
[paypalme-img]: https://img.shields.io/badge/paypal-donate-brightgreen.svg

[czfriendly-url]: http://commitizen.github.io/cz-cli
[czfriendly-img]: https://img.shields.io/badge/commitizen-friendly-brightgreen.svg

[gkfriendly-url]: https://greenkeeper.io/
[gkfriendly-img]: https://img.shields.io/badge/greenkeeper-friendly-brightgreen.svg

[codementor-url]: https://www.codementor.io/tunnckocore?utm_source=github&utm_medium=button&utm_term=tunnckocore&utm_campaign=github
[codementor-img]: https://img.shields.io/badge/code%20mentor-live%20session-brightgreen.svg

[istanbulcov-url]: https://twitter.com/tunnckoCore/status/841768516965568512
[istanbulcov-img]: https://img.shields.io/badge/istanbul-400%25-brightgreen.svg

[following-semver-url]: http://semver.org
[following-semver-img]: https://img.shields.io/badge/following-semver-brightgreen.svg

[strelease-url]: https://github.com/conventional-changelog/standard-version
[strelease-img]: https://img.shields.io/badge/using-standard%20version-brightgreen.svg

[supportchat-url]: https://gitter.im/tunnckoCore/support
[supportchat-img]: https://img.shields.io/gitter/room/tunnckoCore/support.svg?colorB=049372

[slackchat-url]: https://tunnckocore-slack.now.sh/
[slackchat-img]: https://img.shields.io/badge/join-slack%20chat-F62459.svg

[bulgaria-url]: https://www.google.bg/search?q=Sofia%2C+Bulgaria "One of the top 10 best places for start-up business in the world, especially in IT technologies"

[changelogmd-url]: https://github.com/{%= repository %}/blob/master/CHANGELOG.md
[conventions-url]: https://github.com/bcoe/conventional-changelog-standard/blob/master/convention.md
[tunnckocore-twitter-url]: https://twitter.com/tunnckoCore
[opensource-project-url]: http://openopensource.org
[nyc-istanbul-url]: https://istanbul.js.org
[circle-ci-url]: https://circleci.com
[appveyor-ci-url]: https://appveyor.com
[codecov-coverage-url]: https://codecov.io
[semver-url]: http://semver.org
[eslint-url]: http://eslint.org
[conventional-messages-url]: https://github.com/conventional-changelog/conventional-changelog
[gk-integration-url]: https://github.com/integration/greenkeeper
[daviddm-url]: https://david-dm.org
[open-issue-url]: https://github.com/{%= repository %}/issues/new
[contributing-url]: https://github.com/{%= repository %}/blob/master/CONTRIBUTING.md
[absolute-coverage-url]: https://github.com/{%= repository %}/blob/master/package.json
4 changes: 4 additions & 0 deletions foo-quxie/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@


## 0.0.0 - 2017-07-18
- Initial commit
Loading

0 comments on commit 20c1ca1

Please sign in to comment.